This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: emacs and large-address awareness under recent snapshots

On 8/10/2011 10:56 AM, Ken Brown wrote:
On 8/9/2011 10:39 PM, Ryan Johnson wrote:
Given that the static heap is only 12MB, with most of that arguably
occupied by stuff that isn't going away, what if we did "just ignore the
static heap" (mostly)? Anything freed from that regionjust gets dropped
on the floor and all new requests are served from the cygwin heap? I
assume temacs stays away from the dynamic heap, since otherwise the dump
would be corrupted.

I tried forcing malloc to reinitialize itself in emacs.c, and emacs crashed almost immediately. A gdb backtrace showed that the memory got corrupted as soon as realloc got called on objects that were originally stored in the static heap. After reinitialization, malloc had no knowledge of memory allocation in the static heap.

I think there's an obvious solution to this. At the time of reinitialization, we save the previous malloc state. Then if realloc is called on a pointer to something in the static heap, we temporarily restore the old state and let realloc proceed as it did in temacs prior to dumping.

Unless I've (again) missed something obvious, it shouldn't be too hard to do this. I'm about to go on vacation, but I should have a new emacs release within a couple weeks.


Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]