MCPcopy Create free account
hub / github.com/Simple-XX/SimpleKernel / AlignedAlloc

Method AlignedAlloc

tests/unit_test/virtual_memory_test.cpp:29–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27 }
28
29 auto AlignedAlloc(size_t alignment, size_t size) -> void* {
30 void* ptr = nullptr;
31 if (posix_memalign(&ptr, alignment, size) == 0) {
32 allocated_blocks_[ptr] = size;
33 return ptr;
34 }
35 return nullptr;
36 }
37
38 void Free(void* ptr) {
39 if (ptr == nullptr) {

Callers 1

aligned_allocFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected