This is the mail archive of the mailing list for the glibc 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: [PATCH] malloc: Rewrite dumped heap for compatibility in __malloc_set_state

Florian Weimer <> writes:
> 	(do_check_chunk): Skip dumped fake mmaped chunks.

mmapped or mmap'd ?  Given we have chunk_is_mmapped() "mmapped" should
be preferred over "mmaped".

Based on the code changes, I see that you're simply discarding anything
that used to be in the various free lists, so they can never be returned
by malloc, and thus never violate the new ABI.  I suggest a comment to
that effect in _malloc_set_state(), since it won't be obvious if you're
only looking at new code (it's obvious when you compare old-v-new).

Otherwise, assuming your intent is "throw away everything from before
the dump", I think you've nailed it :-)

We should probabably document the wasted memory in the
_malloc_set_state() documentation, if we had documentation for it...

Your code changes data in the main heap, but doesn't lock the main heap.
Is _malloc_set_state() supposed to be thread-safe?  If so, you should
lock the heap just to ensure that the changes are visible to other

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