[Top][All Lists]

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

bug#9273: 23.3; malloc initialization should (sometimes) happen at runti

From: Ken Brown
Subject: bug#9273: 23.3; malloc initialization should (sometimes) happen at runtime
Date: Thu, 11 Aug 2011 17:45:41 -0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0

On 8/10/2011 11:56 AM, Eli Zaretskii wrote:
Date: Tue, 09 Aug 2011 16:09:48 -0400
From: Ken Brown<address@hidden>
I made one naive attempt to do this, but it didn't work (and it was
Cygwin specific).  Namely, I made unexec (for Cygwin) set
_malloc_initialized = 0 before dumping.  The resulting emacs aborted
as soon as it was started.  I haven't figured out what went wrong,
but I'm not sure that's the right answer anyway.

The problem was that realloc got called on memory that had been allocated prior to dumping, and the malloc information that was used then had disappeared. 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 patch ready within a couple weeks.


reply via email to

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