MCPcopy Create free account
hub / github.com/KentBeck/BPlusTree3 / cache_aligned_alloc

Function cache_aligned_alloc

python/bplustree_c_src/node_ops.c:348–358  ·  view source on GitHub ↗

Cache-aligned memory allocation functions */

Source from the content-addressed store, hash-verified

346
347/* Cache-aligned memory allocation functions */
348void* cache_aligned_alloc(size_t size) {
349#ifdef _WIN32
350 return _aligned_malloc(size, CACHE_LINE_SIZE);
351#else
352 void *ptr;
353 if (posix_memalign(&ptr, CACHE_LINE_SIZE, size) != 0) {
354 return NULL;
355 }
356 return ptr;
357#endif
358}
359
360void cache_aligned_free(void* ptr) {
361#ifdef _WIN32

Callers 1

node_createFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected