Re: Something is broken in repack

2007-12-14 Thread Wolfram Gloger
Hi, > Uh what? Someone crank out his copy of "The Art of Computer > Programming", I think volume 1. Best fit is known (analyzed and proven > and documented decades ago) to be one of the worst strategies for memory > allocation. Exactly because it leads to huge fragmentation problems. Well, quo

Re: Something is broken in repack

2007-12-14 Thread Wolfram Gloger
Hi, > Maybe an malloc/free/mmap wrapper that records the requested sizes and > alloc/free order and dumps them to file so that one can make a compact > git-free standalone test case for the glibc maintainers might be a good > thing. I already have such a wrapper: http://malloc.de/malloc/mtrace-2

Re: Something is broken in repack

2007-12-14 Thread Wolfram Gloger
Hi, > Note that delta following involves patterns something like > >allocate (small) space for delta >for i in (1..depth) { > allocate large space for base > allocate large space for result > .. apply delta .. > free large space for base > free small space fo

Re: Something is broken in repack

2007-12-14 Thread Wolfram Gloger
Hi, > >>if (progress->total) { > >>unsigned percent = n * 100 / progress->total; > >>if (percent != progress->last_percent || progress_update) { > >> + struct mallinfo m = mallinfo(); > >>progress->last_percent = percent; > >> -

Re: Can realloc be marked as a mallloc-like function?

2007-07-17 Thread Wolfram Gloger
> On Mon, Jul 16, 2007 at 02:39:39PM -0000, Wolfram Gloger wrote: > > > int *p; > > > p = malloc (4); > > > *p = 0; > > > p = realloc (p, 4); > > > *p = 1; > > > > By that reasoning, consider: > > > > int *p; > >

Re: Can realloc be marked as a mallloc-like function?

2007-07-16 Thread Wolfram Gloger
Hi, First, I assume we are talking about C realloc here, not just a "realloc-like" function which may have other semantics and for which __attribute_malloc__ may not be appropriate. > > It looks like gcc assumes a functon marked with DECL_IS_MALLOC won't > > return an address which can alias some