This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 0/5] obstacks again
- From: Alan Modra <amodra at gmail dot com>
- To: Paul Eggert <eggert at cs dot ucla dot edu>
- Cc: libc-alpha at sourceware dot org, bug-gnulib at gnu dot org
- Date: Wed, 5 Nov 2014 21:51:25 +1030
- Subject: Re: [PATCH 0/5] obstacks again
- Authentication-results: sourceware.org; auth=none
- References: <20141029033201 dot GI4267 at bubble dot grove dot modra dot org> <5450983F dot 3030608 at cs dot ucla dot edu> <20141029220223 dot GP4267 at bubble dot grove dot modra dot org> <5451B1F6 dot 7060305 at cs dot ucla dot edu> <20141030060723 dot GR4267 at bubble dot grove dot modra dot org> <5453E801 dot 6050402 at cs dot ucla dot edu> <20141103070707 dot GA4305 at bubble dot grove dot modra dot org> <54589199 dot 10006 at cs dot ucla dot edu>
On Tue, Nov 04, 2014 at 12:43:05AM -0800, Paul Eggert wrote:
> >I've added: "Earlier versions of obstacks allowed you to use
> >@code{obstack_blank} to shrink objects. This will no longer work."
>
> But this doesn't suffice for obstack_blank_stack, which *can* shrink objects
> and where user code relies on this feature.
Right, the entire para on shrinking object is now:
@cindex shrinking objects
You can use @code{obstack_blank_fast} with a ``negative'' size
argument to make the current object smaller. Just don't try to shrink
it beyond zero length---there's no telling what will happen if you do
that. Earlier versions of obstacks allowed you to use
@code{obstack_blank} to shrink objects. This will no longer work.
> I installed the attached patches to gnulib to try to implement the above;
> please let me know of any issues.
Thanks for doing all this. I particularly like the removal of
obstack_chunk_alloc and obstack_chunk_free casts for version 2, except
here:
#define obstack_chunkfun(h, newchunkfun) \
((void) ((h)->chunkfun.extra = _OBSTACK_CAST (void *(*) (void *, size_t), \
newchunkfun)))
and in obstack_freefun. I think you need to keep the casts, otherwise
you can only specify new extra arg alloc and free functions.
--
Alan Modra
Australia Development Lab, IBM