1 #include "osi_mcas_obj_cache.h"
2 #include <osi/osi_includes.h>
3 #include <osi/osi_types.h>
4 #include <afs/afsutil.h>
7 osi_mcas_obj_cache_create(osi_mcas_obj_cache_t
* gc_id
, size_t size
,
11 ("osi_mcas_obj_cache_create: size, adjsize %d\n", size
,
12 size
+ sizeof(int *)));
14 *(int *)gc_id
= gc_add_allocator(size
+ sizeof(int *), tag
);
17 void gc_trace(int alloc_id
);
18 int gc_get_tag(int alloc_id
);
19 int gc_get_blocksize(int alloc_id
);
22 osi_mcas_obj_cache_alloc(osi_mcas_obj_cache_t gc_id
)
27 ptst
= critical_enter();
28 obj
= (void *)gc_alloc(ptst
, gc_id
);
32 ("GC: osi_mcas_obj_cache_alloc: block of size %d "
33 #if OSI_DATAMODEL_IS(OSI_ILP32_ENV)
39 gc_get_blocksize(gc_id
),
47 osi_mcas_obj_cache_free(osi_mcas_obj_cache_t gc_id
, void *obj
)
52 ("GC: osi_mcas_obj_cache_free: block of size %d "
53 #if OSI_DATAMODEL_IS(OSI_ILP32_ENV)
59 gc_get_blocksize(gc_id
),
63 ptst
= critical_enter();
64 gc_free(ptst
, (void *)obj
, gc_id
);
69 osi_mcas_obj_cache_destroy(osi_mcas_obj_cache_t gc_id
)
71 /* TODO: implement, will need to implement gc_remove_allocator and related
72 * modifications in gc.c */