gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Re: [Mingw-users] Porting gcl to windows using mingw


From: Paul Garceau
Subject: [Gcl-devel] Re: [Mingw-users] Porting gcl to windows using mingw
Date: Wed, 23 Jan 2002 16:10:34 -0800

----- Original Message -----
From: Earnie Boyd <address@hidden>
Date: Wednesday, January 23, 2002 8:25 am
Subject: Re: [Mingw-users] Porting gcl to windows using mingw

> Dan Stanger wrote:
> > 
> > The gnu common lisp group is currently trying to build a working 
> gcl on
> > windows using mingw,
> > and have a few questions.
> > First, we have a simple test program, which follows, and the 
> results:> 
> > #define NULL_OR_ON_C_STACK(y) (((void *)(y)) < ((void *)0x230000))
> > 
> > int e;
> > main()
> > {
> >    int i;
> >    printf("address of i was %x e was %x\n",&i,&e);
> >    printf("macro of i was %x e was%x\n",
> > NULL_OR_ON_C_STACK(&i),NULL_OR_ON_C_STACK(&e));
> >    x();
> > }
> > x()
> > {
> >    int i;
> >    printf("address of i was %x\n",&i);
> >    printf("address of malloc was %x\n",malloc(100));
> > }
> > E:\>a.exe
> > address of i was 22ff5c e was 403000
> > macro of i was 1 e was
> > 0
> > address of i was 22ff3c
> > address of malloc was 3f4830
> > 
> > So the stack is going down, but the value returned from malloc is
> > between the program,
> > and the static variable e.  Our garbage collection is relying on a
> > contigous area of memory.
> > 
> > My questions are:
> > 1. Is there some way that we can link so that malloc is above 
> the static
> > area?
> > 
> 
> Perhaps you should check the use of HeapCreate, HeapAlloc, etc set of
> Win32 API functions.

  You might also want to take a look at the ld -help options.  There are 
several methods (options) noted that may allow you to manually allocate 
where you want things to be (.data) within the resulting .exe at link 
time.  If you a;ways know where your mallocated block begins, then you 
can define where you want your next .data block or .data variable to 
start (_may_ allow for the contiguosness you are indicating you require 
for garbage collection).  HeapCreate and HeapAlloc do allow for 
prioritizing of .data space useage.

  Paul G.  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]