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: Thu, 30 Oct 2014 08:32:23 +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>
On Wed, Oct 29, 2014 at 12:33:19AM -0700, Paul Eggert wrote:
> Thanks for doing all this. The gnulib patches are good as far as they go,
> but they need one more change: alignments should also change from int to
> size_t. The first attached gnulib patch does that, plus it fixes a
> longstanding integer overflow bug that can occur with large alignments (plus
> large sizes). While we're in the neighborhood we should be using C11's
> alignof rather than reinventing that particular wheel; the second attached
> gnulib patch does that. I've installed your five gnulib patches plus the two
> attached patches into gnulib.
One thing though, I didn't put the ChangeLog diffs in the patch as I
usually add them when committing.
> Two things for the glibc patch. First, the updated gnulib patches need to
> be merged into the glibc patch. Second, the manual needs to be updated to
> match the revised API induced by all these patches.
Ow! The manual reflects obstacks as they were 20 years ago.
Hmm, looking over it I see a misfeature that I've removed.
@cindex shrinking objects
You can use @code{obstack_blank} 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.
It is no longer possible to shrink an obstack with obstack_blank (but
you can still do that with obstack_blank_fast).
--
Alan Modra
Australia Development Lab, IBM