1 #include "osi_mcas_obj_cache.h"
2 #include <afs/afsutil.h>
5 osi_mcas_obj_cache_create(osi_mcas_obj_cache_t * gc_id, size_t size)
8 ("osi_mcas_obj_cache_create: size, adjsize %d\n", size,
9 size + sizeof(int *)));
11 *(int *)gc_id = gc_add_allocator(size + sizeof(int *));
14 void gc_trace(int alloc_id);
15 int gc_get_blocksize(int alloc_id);
18 osi_mcas_obj_cache_alloc(osi_mcas_obj_cache_t gc_id)
23 #if MCAS_ALLOC_DISABLED
24 #warning XXXXX mcas allocator cache is DISABLED for debugging!!
25 obj = malloc(gc_get_blocksize(gc_id));
27 ptst = critical_enter();
28 obj = (void *)gc_alloc(ptst, gc_id);
35 osi_mcas_obj_cache_free(osi_mcas_obj_cache_t gc_id, void *obj)
39 #if MCAS_ALLOC_DISABLED
40 #warning XXXXX mcas allocator cache is DISABLED for debugging!!
42 ptst = critical_enter();
43 gc_free(ptst, (void *)obj, gc_id);
49 osi_mcas_obj_cache_destroy(osi_mcas_obj_cache_t gc_id)
51 /* TODO: implement, will need to implement gc_remove_allocator and related
52 * modifications in gc.c */