[PATCH v2] lib/slab: introduce sl_allocz() function and use it in Babel

Maria Matejka maria.matejka at nic.cz
Mon Nov 23 14:14:00 CET 2020


On 11/23/20 1:45 PM, Toke Høiland-Jørgensen wrote:
> andreas at rammhold.de writes:
> 
>> While testing this patch I asked myself if there are actually still
>> valid users of non-zeroed memory and if we shouldn't just change the
>> default to be zeroed? That would also remove the need to patch every
>> single call site.
> 
> Well there are other callers that already perform manual clearing, so
> just changing sl_alloc() would lead to double-clearing there. Not a huge
> issue, I suppose, but I'll leave it up to the maintainers to decide :)

An allocated structure from slab is typically intended to be used in 
hotpaths with fast alloc and dealloc. After going multithreaded, it may 
have some impact on performance. I think this is more of a documentation 
issue, rather than a reason to introduce double-clearing.

Maria


More information about the Bird-users mailing list