bin/varnishd/storage/storage_umem.c
static void
smu_open_init(void)
{
	static int inited = 0;

	if (inited++) {
		AN(libumem_hndl);
		AN(umem_allocf);
		return;
	}

	if (smu_umem_loaded())
		smu_umem_loaded_warn();
	else
		AN(getenv(env_umem_options));

	AZ(libumem_hndl);
	libumem_hndl = dlopen("libumem.so", RTLD_LAZY);
	AN(libumem_hndl);

#define DLSYM_UMEM(fptr,sym)					\
	do {							\
		fptr = (sym ## _f) dlsym(libumem_hndl, #sym);	\
		AN(fptr);					\
	} while(0)

	DLSYM_UMEM(umem_allocf, umem_alloc);
	DLSYM_UMEM(umem_freef, umem_free);
	DLSYM_UMEM(umem_cache_createf, umem_cache_create);
	DLSYM_UMEM(umem_cache_destroyf, umem_cache_destroy);
	DLSYM_UMEM(umem_cache_allocf, umem_cache_alloc);
	DLSYM_UMEM(umem_cache_freef, umem_cache_free);

#undef DLSYM_UMEM
}
/*
 * Load the symbols for use in the child process, assert if they fail to load.
 */
Load the symbols for use in the child process, assert if they fail to load.
Load the symbols for use in the child process assert if they fail to load .
static void
smu_open_init(void)
{
	static int inited = 0;
	if (inited++) {
		AN(libumem_hndl);
		AN(umem_allocf);
		return;
	}
	if (smu_umem_loaded())
		smu_umem_loaded_warn();
	else
		AN(getenv(env_umem_options));
	AZ(libumem_hndl);
	libumem_hndl = dlopen("libumem.so", RTLD_LAZY);
	AN(libumem_hndl);
#define DLSYM_UMEM(fptr,sym)					\
	do {							\
		fptr = (sym ## _f) dlsym(libumem_hndl, #sym);	\
		AN(fptr);					\
	} while(0)
	DLSYM_UMEM(umem_allocf, umem_alloc);
	DLSYM_UMEM(umem_freef, umem_free);
	DLSYM_UMEM(umem_cache_createf, umem_cache_create);
	DLSYM_UMEM(umem_cache_destroyf, umem_cache_destroy);
	DLSYM_UMEM(umem_cache_allocf, umem_cache_alloc);
	DLSYM_UMEM(umem_cache_freef, umem_cache_free);
#undef DLSYM_UMEM
}
static void smu_open_init ( void ) { static int inited = 0 ; if ( inited ++ ) { AN ( libumem_hndl ) ; AN ( umem_allocf ) ; return ; } if ( smu_umem_loaded ( ) ) smu_umem_loaded_warn ( ) ; else AN ( getenv ( env_umem_options ) ) ; AZ ( libumem_hndl ) ; libumem_hndl = dlopen ( " " , RTLD_LAZY ) ; AN ( libumem_hndl ) ; #define DLSYM_UMEM ( fptr , sym ) 					\
	do {							\
		fptr = (sym ## _f) dlsym(libumem_hndl, #sym);	\
		AN(fptr);					\
	} while(0) DLSYM_UMEM ( umem_allocf , umem_alloc ) ; DLSYM_UMEM ( umem_freef , umem_free ) ; DLSYM_UMEM ( umem_cache_createf , umem_cache_create ) ; DLSYM_UMEM ( umem_cache_destroyf , umem_cache_destroy ) ; DLSYM_UMEM ( umem_cache_allocf , umem_cache_alloc ) ; DLSYM_UMEM ( umem_cache_freef , umem_cache_free ) ; #undef  DLSYM_UMEM }
Load the symbols for use in the child process, assert if they fail to load.
Load the symbols for use in the child process assert if they fail to load .