mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
alloc: fix free
This commit is contained in:
@@ -37,10 +37,10 @@ void *alloc(size_t size) {
|
||||
|
||||
void free(void *ptr) {
|
||||
size_t *start = ptr;
|
||||
start -= 1;
|
||||
size_t size = *start;
|
||||
start += 1;
|
||||
scache_t *cache = getcachefromsize(size);
|
||||
slab_free(cache, ptr);
|
||||
slab_free(cache, start);
|
||||
}
|
||||
|
||||
void alloc_init() {
|
||||
|
||||
Reference in New Issue
Block a user