This is the mail archive of the libc-alpha@sources.redhat.com 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]

Re: Fix obscure obstack bug


DJ Delorie wrote:-

> 
> What about if the allocator actually *allocates* a larger chunk the
> first time?  In that case, you *would* want to use h->chunk_size.
> Perhaps the user-defined allocator must guarantee that h->chunk_size
> and the initial allocation agree?

I think it's counterintuitive if you allocate a size other than that
requested.

Note my patch only fixes the initial allocation - all subsequent
allocations are handled by different code in obstack.c that does not
have the bug; and does not use h->chunk_size after calling the
allocation routine.  So the patch is also making obstack.c internally
self-consistent.

Neil.


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