Re: XMALLOC() et al

2024-07-20 Thread Paul Eggert
On 2024-07-20 03:27, Bruno Haible wrote: This is where our opionions differ. Yes, and I'm well aware of the advantages you listed for XMALLOC. In practice, for me, they don't outweigh the disadvantages. (In that sense they're like the advantages that C++ has over C)

Re: XMALLOC() et al

2024-07-20 Thread Bruno Haible
Paul Eggert wrote: > > GNU gettext uses the XMALLOC macro in more than 100 places. It's > > just so convenient to do a memory allocation in 1 line of code: > > I find it more convenient to write this: > >context = xmalloc (sizeof *context); > > than this (taken from GNU gettext): > >con

Re: XMALLOC() et al

2024-07-19 Thread Paul Eggert
On 2024-07-19 18:59, Bruno Haible wrote: GNU gettext uses the XMALLOC macro in more than 100 places. It's just so convenient to do a memory allocation in 1 line of code: I find it more convenient to write this: context = xmalloc (sizeof *context); than this (taken from GNU gettext): cont

Re: XMALLOC() et al

2024-07-19 Thread Bruno Haible
Alejandro Colomar wrote: > > Are XMALLOC et al. part of the public API, or are they only internal > > helper macros? They are public API. This can be seen from the fact that - the macro is defined in xalloc.h, - the module description modules/xalloc lists this file as the file to

Re: XMALLOC() et al

2024-07-19 Thread Paul Eggert
On 2024-07-19 17:13, Alejandro Colomar wrote: Are XMALLOC et al. part of the public API, or are they only internal helper macros? Are there current users of it (apart from gnulib itself)? I'm interested in discussing some details about that set of macros if they're not set in stone.

XMALLOC() et al (was: [PATCH v1] xstrtol: 1 is not a valid base)

2024-07-19 Thread Alejandro Colomar
ding both. > > Paul added the documentation for xstrtol(). Thanks. > There is no macro or symbol named MALLOC in gnulib; I don't know what you > are referring to. D'oh, I was referring to XMALLOC (et al.). I've found the documentation for ALLOC (et al.) and have now seen that X