[Top][All Lists]

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

Re: w32/w64 Emacs and gmalloc()

From: Eli Zaretskii
Subject: Re: w32/w64 Emacs and gmalloc()
Date: Sat, 01 Mar 2014 09:02:23 +0200

> From: Stefan Monnier <address@hidden>
> Date: Fri, 28 Feb 2014 12:21:37 -0500
> Cc: address@hidden
> > Once the preloaded data are dumped, they are not freed nor realloc'ed, or 
> > rather, the space they occupied is not collected.
> What changes did you make to get this result?

Fabrice implemented mmap emulation for Windows, for use in allocating
buffer text, and then uses system malloc for the rest of allocations.

> > This is suboptimal, but there is no way around with the w32 api alone
> > (no way that I know of without  using your own allocator).
> IIUC the problem is with calling "malloc" before the dump and then
> "free" that block after the dump, right?

Yes, that's the problem.

> If so, there's still some room for improvement since Emacs could
> reuse a malloc'd area internally (without going through
> free+malloc).

If Emacs already does that, there's no problem.  What Fabrice wrote
just says that calls to 'free' that reference memory allocated before
dumping will be a no-op, and calls to 'realloc' that enlarge the block
will malloc new memory.

reply via email to

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