This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] Remove `attr != NULL' assert in allocate_stack.
On 01/11/2013 10:29 AM, Roland McGrath wrote:
> It's OK with me though I'm not sure why you are motivated to remove it.
> assert is normally used exactly for things verifying internal assumptions.
This is probably as good a time as any to have a quick discussion
I can agree that asserts are good for complicated things like page
size assumptions, or alignments determined elsewhere in the code that
initializes the static TLS data. It's hard to coordinate those two
pieces of data so you use an assert to ensure that your expectations
Yet for simple things like input arguments to a function that is
on the hot path of all pthread_create calls, is it really necessary?
One caller to a function that was refactored because of size has a
well known and controlled set of input arguments.
Does that make sense?