Mail Archives: cygwin/1997/05/18/01:53:38
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 AT cs DOT mu DOT oz DOT 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 AT 128 DOT 250 DOT 37 DOT 3 | -- the last words of T. S. Garp.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -