mirror of
https://github.com/cculianu/Fulcrum.git
synced 2026-08-13 12:33:27 +02:00
Jemalloc is better suited for the memory usage pattern of Fulcrum, which is allocating/freeing lots of random sized buffers from multiple threads, resulting in lots of fragmentation. Jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support.
13 lines
193 B
C++
13 lines
193 B
C++
#include <cstdlib>
|
|
#include <jemalloc/jemalloc.h>
|
|
|
|
int main()
|
|
{
|
|
if (malloc(1) == nullptr)
|
|
return 1;
|
|
|
|
if (mallocx(1, MALLOCX_ZERO) == nullptr)
|
|
return 1;
|
|
|
|
return 0;
|
|
}
|