MCPcopy Create free account
hub / github.com/Niko1221/Strata / engram_aligned_alloc

Function engram_aligned_alloc

engine/src/hy4flash/run/hy4_engram.cpp:222–230  ·  view source on GitHub ↗

---------------------------------------------------------------- aligned alloc

Source from the content-addressed store, hash-verified

220
221// ---------------------------------------------------------------- aligned alloc
222void* engram_aligned_alloc(size_t bytes) {
223#if defined(_WIN32)
224 return _aligned_malloc(bytes, 4096);
225#else
226 void* p = nullptr;
227 if (posix_memalign(&p, 4096, bytes) != 0) return nullptr;
228 return p;
229#endif
230}
231void engram_aligned_free(void* p) {
232#if defined(_WIN32)
233 _aligned_free(p);

Callers 3

fetch_rawMethod · 0.85
bench_pagesFunction · 0.85
hy4_main.hip.cppFile · 0.85

Calls

no outgoing calls

Tested by 1

bench_pagesFunction · 0.68