MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / liballoc_free

Function liballoc_free

Kernel/src/liballoc/_liballoc.cpp:45–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45int liballoc_free(void* addr, size_t pages) {
46 for(size_t i = 0; i < pages; i++){
47 uint64_t phys = Memory::VirtualToPhysicalAddress((uintptr_t)addr + i);
48 Memory::FreePhysicalMemoryBlock(phys);
49 }
50 Memory::KernelFree4KPages(addr, pages);
51 return 0;
52}
53
54void* kmalloc(size_t sz){
55 return _kmalloc(sz);

Callers 1

PREFIX(free)Function · 0.85

Calls 3

VirtualToPhysicalAddressFunction · 0.85
FreePhysicalMemoryBlockFunction · 0.85
KernelFree4KPagesFunction · 0.85

Tested by

no test coverage detected