talloc vs malloc speed

Florian Weimer fweimer at redhat.com
Tue Apr 18 07:07:35 UTC 2023


* Andreas Schneider:

> On Monday, 17 April 2023 21:15:23 CEST Florian Weimer wrote:
>> > The malloc attribute can be set to a few functions, that helps. I use
>> > the attribute with the deallocator to avoid issue on free with
>> > destructors.
>> 
>> I *think* that should be safe, but I'm not entirely sure.  Maybe ask on
>> the GCC list?
>
> Is it valid to set the the malloc attribute for talloc_strdup()?

It depends on how it's implemented.  If it returns a fresh pointer
aligned like malloc would, it's appropriate.  The <string.h> header from
glibc uses it for strdup, too.

Thanks,
Florian




More information about the samba-technical mailing list