interplane.Get Omega
Read in your language

klib

[Ported from github.com/attractivechaos/klib] added block arena

Brought by drakestapleton

branch master Branches Tags History

klib / test / kbarena_test.c

19 lines · 316 bytes Raw Blame History
1#include <stdio.h>
2#include "kbarena.h"
3
4int main(void)
5{
6 int i;
7 void *ba;
8 ba = kba_init(1000);
9 for (i = 0; i < 100; ++i)
10 kba_alloc(ba, 23, 1);
11 kba_save(ba);
12 for (i = 0; i < 100; ++i)
13 kba_alloc(ba, 29, 1);
14 kba_restore(ba);
15 for (i = 0; i < 100; ++i)
16 kba_alloc(ba, 29, 1);
17 kba_destroy(ba);
18 return 0;
19}