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