delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/05/18/01:53:38

From: fjh AT cs DOT mu DOT OZ DOT AU (Fergus Henderson)
Subject: Re: kaffe 0.9 and gnuwin b18 don't mix
18 May 1997 01:53:38 -0700 :
Sender: mail AT cygnus DOT com
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199705180755.RAA21968.cygnus.gnu-win32@mundook.cs.mu.OZ.AU>
Original-To: peterham AT peterham DOT com
Original-Cc: gnu-win32 AT cygnus DOT com (Cygnus GNU-win32 mailing list)
In-Reply-To: <337E8BEC.77B5@peterham.com> from "Peter Ham" at May 17, 97 08:56:12 pm
X-Mailer: ELM [version 2.4 PL24]
Original-Sender: owner-gnu-win32 AT cygnus DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019