aboutsummaryrefslogtreecommitdiff
path: root/src/common/libkogata
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2015-03-13 18:02:01 +0100
committerAlex Auvolat <alex@adnab.me>2015-03-13 18:02:01 +0100
commit151edb44eea9bf25ec466133e9dbef87bd6b1372 (patch)
tree14537daf1be1896a5453dcff21593a4233f1c3b5 /src/common/libkogata
parent5bc7fcc00507bbc5ff5bf957a1589209f8495534 (diff)
downloadkogata-151edb44eea9bf25ec466133e9dbef87bd6b1372.tar.gz
kogata-151edb44eea9bf25ec466133e9dbef87bd6b1372.zip
Add missing mutex-locking in procesc.c ; discovered design fault somewhere.
Diffstat (limited to 'src/common/libkogata')
-rw-r--r--src/common/libkogata/slab_alloc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/libkogata/slab_alloc.c b/src/common/libkogata/slab_alloc.c
index 6d0b9d6..837a965 100644
--- a/src/common/libkogata/slab_alloc.c
+++ b/src/common/libkogata/slab_alloc.c
@@ -175,6 +175,7 @@ void* slab_alloc(mem_allocator_t* a, size_t sz) {
add_free_descriptor(a, fcd);
return 0;
}
+ /*dbg_printf("New cache 0x%p\n", fc->region_addr);*/
fc->n_free_objs = 0;
fc->first_free_obj = 0;
@@ -195,6 +196,7 @@ void* slab_alloc(mem_allocator_t* a, size_t sz) {
ASSERT(fc->first_free_obj != 0);
object_t *x = fc->first_free_obj;
+ /*dbg_printf("Alloc 0x%p\n", x);*/
fc->first_free_obj = x->next;
fc->n_free_objs--;
@@ -226,7 +228,6 @@ void* slab_alloc(mem_allocator_t* a, size_t sz) {
}
void slab_free(mem_allocator_t* a, void* addr) {
-
for (int i = 0; a->types[i].obj_size != 0; i++) {
size_t region_size = PAGE_SIZE * a->types[i].pages_per_cache;
for (cache_t *r = a->slabs[i].first_cache; r != 0; r = r->next_cache) {