talloc: Other minor issues/queries

Arran Cudbard-Bell a.cudbardb at freeradius.org
Tue Oct 20 20:10:14 UTC 2020


Just to keep this separate from the memlimit/pools discussion.

- I've noticed talloc_realloc_size clears the name/type of the chunk be 
 allocated.  This isn't mentioned in the documentation.  Is clearing the 
 name/type of the chunk expected behaviour?

- talloc_set_memlimit is marked as deprecated in the
  current HEAD version of talloc, with a note to use cgroups.
  cgroups wouldn't offer equivalent functionality for us.  Could I humbly
  request memlimits not be deprecated? :)

- Is there any appetite for functions which return chunks of a specific
  alignment?  i.e. talloc_aligned, talloc_aligned_array,
  talloc_aligned_pool.
  I've had to fudge some horrible variants of the above for local use.
  We use aligned memory for the following purposes:
  - Page aligned pools for protecting memory areas with mprotect
    to prevent runtime modifications.
  - 8 byte aligned buffers that can have the start and end regions
    easily poisoned with ASAN.
  - Cache line aligned ring buffers, with the cache line 
    alignment done to reduce contention where the producer and
    consumer are close.

Many Thanks,
-Arran



More information about the samba-technical mailing list