| 32 | #endif |
| 33 | |
| 34 | TIMER_CACHE *timer_cache_create(void) |
| 35 | { |
| 36 | TIMER_CACHE *cache = mem_malloc(sizeof(TIMER_CACHE)); |
| 37 | |
| 38 | fiber_avl_create(&cache->tree, |
| 39 | (int (*)(const void*, const void*)) avl_cmp_fn, |
| 40 | sizeof(TIMER_CACHE_NODE), offsetof(TIMER_CACHE_NODE, node)); |
| 41 | ring_init(&cache->caches); |
| 42 | cache->cache_max = 1000; |
| 43 | cache->objs = array_create(100, ARRAY_F_UNORDER); |
| 44 | cache->objs2 = array_create(100, ARRAY_F_UNORDER); |
| 45 | |
| 46 | return cache; |
| 47 | } |
| 48 | |
| 49 | unsigned timer_cache_size(TIMER_CACHE *cache) |
| 50 | { |
no test coverage detected
searching dependent graphs…