MCPcopy Create free account
hub / github.com/Snapchat/Valdi / bf_aligned_malloc

Function bf_aligned_malloc

third-party/quickjs/src/quickjs/libbf.c:7517–7528  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7515}
7516
7517static void *bf_aligned_malloc(bf_context_t *s, size_t size, size_t align)
7518{
7519 void *ptr;
7520 void **ptr1;
7521 ptr = bf_malloc(s, size + sizeof(void *) + align - 1);
7522 if (!ptr)
7523 return NULL;
7524 ptr1 = (void **)(((uintptr_t)ptr + sizeof(void *) + align - 1) &
7525 ~(align - 1));
7526 ptr1[-1] = ptr;
7527 return ptr1;
7528}
7529
7530static void bf_aligned_free(bf_context_t *s, void *ptr)
7531{

Callers 2

ntt_mallocFunction · 0.85
ntt_static_initFunction · 0.85

Calls 1

bf_mallocFunction · 0.85

Tested by

no test coverage detected