nvml-sys 0.0.6

A low-level FFI wrapper around the Persistent Memory Development Kit, PMDK (formerly NVML) and its libraries, including libpmem, libpmemobj and others. Currently tracks master after version 1.3.1.
#include "pool.h"

void *
malloc_test(size_t size) {
	custom_allocs++;
	return malloc(size);
}

void
free_test(void *ptr) {
	custom_allocs--;
	free(ptr);
}

int
main(void)
{
	/*
	 * Initialize custom allocator who call malloc from jemalloc.
	 */
	if (nallocx(1, 0) == 0) {
		malloc_printf("Initialization error");
		return (test_status_fail);
	}

	je_pool_set_alloc_funcs(malloc_test, free_test);

	return test_not_init(POOL_TEST_CASES);
}