Hello Vincent,
Vincent Lefevre wrote:
> On 2008-01-25 12:03:15 +0100, Michael Kerrisk wrote:
>> So, I'm not quite clear. Are you happy with the new man page
>> description of alloca()?
>
> I don't like very much the "Its use is discouraged." without any
> information since in practice
> 1. it seems to be very well supported,
> 2. it can improve the efficiency (for instance, it was completely
> removed from the MPFR trunk for a few days to fix a bug, as it
> was also used for very large memory allocations, but I had to
> re-add it for small allocations since the loss in small precisions
> was important in raw timings, and could still be significant in
> some practical applications).
>
> Perhaps something like:
> b
> This function can improve efficiency in some applications compared
> to malloc()/free(). Otherwise its use is discouraged.
>
Fair enough. I reworked the text some more:
NOTES
The alloca() function is machine- and compiler-dependent.
For certain applications, its use can improve efficiency
compared to the use of malloc(3) plus free(3). In cer-
tain cases, it can also simplify memory deallocation in
applications that use longjmp(3) or siglongjmp(3). Oth-
erwise, its use is discouraged.
Because the space allocated by alloca() is allocated
within the stack frame, that space is automatically freed
if the function return is jumped over by a call to
longjmp(3) or siglongjmp(3).
Good enough now?
Cheers,
Michael
--
Michael Kerrisk
Maintainer of the Linux man-pages project
http://www.kernel.org/doc/man-pages/
Want to report a man-pages bug? Look here:
http://www.kernel.org/doc/man-pages/reporting_bugs.html
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]