MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / imalloc_init_check

Function imalloc_init_check

deps/jemalloc/src/jemalloc.c:2227–2242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2225}
2226
2227JEMALLOC_ALWAYS_INLINE bool
2228imalloc_init_check(static_opts_t *sopts, dynamic_opts_t *dopts) {
2229 if (unlikely(!malloc_initialized()) && unlikely(malloc_init())) {
2230 if (config_xmalloc && unlikely(opt_xmalloc)) {
2231 malloc_write(sopts->oom_string);
2232 abort();
2233 }
2234 UTRACE(NULL, dopts->num_items * dopts->item_size, NULL);
2235 set_errno(ENOMEM);
2236 *dopts->result = NULL;
2237
2238 return false;
2239 }
2240
2241 return true;
2242}
2243
2244/* Returns the errno-style error code of the allocation. */
2245JEMALLOC_ALWAYS_INLINE int

Callers 1

imallocFunction · 0.85

Calls 4

malloc_initializedFunction · 0.70
malloc_initFunction · 0.70
malloc_writeFunction · 0.70
set_errnoFunction · 0.50

Tested by

no test coverage detected