~rycwo/forge

3c36fc836f4379bec02a3a8ca4a5abaac83be53b — Ryan Chan 6 months ago 5f26ce9 master
Remove optional jemalloc dependency

Jemalloc and other alternative allocators can be injected at runtime using
LD_PRELOAD as long as libraries are dynamically linked to libc.
3 files changed, 0 insertions(+), 14 deletions(-)

M include/forge/stretchy_buffer.h
M meson.build
M meson_options.txt
M include/forge/stretchy_buffer.h => include/forge/stretchy_buffer.h +0 -3
@@ 198,9 198,6 @@
#define stb__sbgrow(a,n)      (*((void **)&(a)) = stb__sbgrowf((a), (n), sizeof(*(a))))

#include <stdlib.h>
#ifdef FORGE_USE_JEMALLOC
#include <jemalloc/jemalloc.h>
#endif

static void * stb__sbgrowf(void *arr, int increment, int itemsize)
{

M meson.build => meson.build +0 -10
@@ 19,16 19,6 @@ cc = meson.get_compiler('c')

deps += cc.find_library('m', required : false)

jemalloc_dep = dependency(
    'jemalloc',
    version : '>=5.2.0',
    required : get_option('use_jemalloc'))

if jemalloc_dep.found()
    deps += jemalloc_dep
    add_project_arguments('-DFORGE_USE_JEMALLOC', language : 'c')
endif

includes = include_directories('include')

# Pre-compile shaders into SPIR-V IR to be included directly in the binary.

M meson_options.txt => meson_options.txt +0 -1
@@ 1,1 0,0 @@
option('use_jemalloc', type : 'feature', value : 'auto')