On Thu, Mar 09, 2000 at 03:01:08PM +0100, Bertho Stultiens wrote:
> Yes, I know. The way to solve this once and for all is to provide
> malloc() and friends in the core wine and make sure that the objects
> containing then are linked *before* libc. We then write malloc,...
> against wine's allocator (systemheap and whateverheap or map to
> VirtualXXX()). The X-libs will then also automatically use our versions.
> -- mymalloc.c --
> void *malloc(size_t s) { return HeapAlloc(..., s, ...); }
> void free(void *p) { HeapFree(..., p, ...); }
> ..calloc..
> ..memalign..
> etc...
> --
> Then link with:
> ld -o wine mymalloc.o <any>.o -lwine ... -lc
>
> This works and is portable. It does involve carefull linking and not
> juggling with link-order.
OK that obviously makes sense. The only problem I can see is the
speed impact; our Heap* functions presumably way slower than libc's
malloc. Maybe we should just try it and find out...
Huw.
--
Dr. Huw D M Davies | Clarendon Laboratory
[EMAIL PROTECTED] | Parks Road
Tel: +44 1865 272390 | Oxford OX1 3PU
Fax: +44 1865 272400 | UK