kaffe 0.9 and gnuwin b18 don't mix

Fergus Henderson fjh@cs.mu.OZ.AU
Sun May 18 00:55:00 GMT 1997


Peter Ham, you wrote:
> 
> The memory manager in kaffe-0.9 requires that the operating system
> memory allocator return "page" aligned pointers.
> 
> Unfortunately, gnuwin b18 doesn't support memalign(), or valloc(), and
> malloc doesn't return data aligned to kaffe's
> preference.

Well, if you don't mind wasting a large amount of memory, try
the following (msotly untested) code...

/*
** round_up(amount, align) returns `amount' rounded up to the nearest
** alignment boundary.  `align' must be a power of 2.
*/
#define round_up(amount, align) ((((amount) - 1) | ((align) - 1)) + 1)

#define PAGESIZE 4096
#define memalign(size) round_up(malloc((size) + PAGESIZE), PAGESIZE)

-- 
Fergus Henderson <fjh@cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: < http://www.cs.mu.oz.au/~fjh >   |  of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3         |     -- the last words of T. S. Garp.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list