Crate libtcmalloc_sys

Source
Expand description

A Rust raw wrapper over Google’s TCMalloc memory allocator

§Feature flags

  • extension (enabled by default) — TCMalloc extension API
  • numa_aware — Enable NUMA-aware allocation. Need to use TCMALLOC_NUMA_AWARE environment variable at runtime. See TCMalloc comments
  • deprecated_perthread — Use deprecated per-thread caching. Newer systems with Linux kernel version >= 4.18 should not use this.
  • legacy_locking — Use legacy locking. See TCMalloc docs

Logical Page Sizes (These features are mutually exclusive). Larger page size leads to greater performance in expense to increased fragmentation. See TCMalloc tuning guide

  • 8k_pages (enabled by default) — 8k pages
  • 32k_pages — Large pages
  • 256k_pages — 256k pages
  • small_but_slow — 4k pages, option for memory constrained systems

Functions§

NeedsProcessBackgroundActionsextension
Return true if ProcessBackgroundActions should be called on this platform.
ProcessBackgroundActionsextension
Runs housekeeping actions for the allocator off of the main allocation path.
TCMallocInternalDeleteSizedAligned
Free previously allocated memory.
TCMallocInternalNewAlignedNothrowBridge
Allocate size bytes aligned by align.