mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 23:18:21 +00:00
alloc: remove printf
This commit is contained in:
@@ -9,7 +9,6 @@ static size_t allocsizes[CACHE_COUNT] = {32, 64, 128, 256, 512, 1024, 2048, 4096
|
|||||||
static scache_t *caches[CACHE_COUNT];
|
static scache_t *caches[CACHE_COUNT];
|
||||||
|
|
||||||
static void initarea(scache_t *cache, void *obj) {
|
static void initarea(scache_t *cache, void *obj) {
|
||||||
printf("slab ctor called\n");
|
|
||||||
size_t *ptr = obj;
|
size_t *ptr = obj;
|
||||||
*ptr = cache->size - sizeof(size_t);
|
*ptr = cache->size - sizeof(size_t);
|
||||||
memset(ptr + 1, 0, *ptr);
|
memset(ptr + 1, 0, *ptr);
|
||||||
@@ -44,8 +43,6 @@ void free(void *ptr) {
|
|||||||
slab_free(cache, ptr);
|
slab_free(cache, ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void alloc_init() {
|
void alloc_init() {
|
||||||
for (int i = 0; i < CACHE_COUNT; ++i) {
|
for (int i = 0; i < CACHE_COUNT; ++i) {
|
||||||
caches[i] = slab_newcache(allocsizes[i] + sizeof(size_t), 0, initarea, initarea);
|
caches[i] = slab_newcache(allocsizes[i] + sizeof(size_t), 0, initarea, initarea);
|
||||||
|
|||||||
Reference in New Issue
Block a user