Re: [PATCH v6 3/8] regex.3: Desoupify regfree() description

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 4/20/23 21:37, наб wrote:
> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@xxxxxxxxxxxxxxxxxx>
> ---
>  man3/regex.3 | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/man3/regex.3 b/man3/regex.3
> index 3f1529583..e3dd72a74 100644
> --- a/man3/regex.3
> +++ b/man3/regex.3
> @@ -225,12 +225,10 @@ .SS Error reporting
>  .IR errbuf ;
>  the error string is always null-terminated, and truncated to fit.
>  .SS Freeing
> -Supplying
>  .BR regfree ()
> -with a precompiled pattern buffer,
> -.IR preg ,
> -will free the memory allocated to the pattern buffer by the compiling
> -process,
> +invalidates the pattern buffer at

While this ("invalidates") is true, it omits the most important information:
it frees the object.  I think it's better to say that it frees (or
deallocates) the object and any memory allocated within it, since that
already implies invalidating it (due to
<https://port70.net/~nsz/c/c11/n1570.html#6.2.4p2> and
<https://port70.net/~nsz/c/c11/n1570.html#7.22.3p1>), and also tells why
it's necessary to call this function.  Otherwise, it's not clear why we
should call it.  Why would I want to invalidate a buffer?  We can call
memfrob(3) for that :p  Or for secure stuff, arc4random(3).

> +.IR *preg ,
> +which must have been initialized via
>  .BR regcomp ().
>  .SH RETURN VALUE
>  .BR regcomp ()

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux