diff options
| author | Ethan Werner <mail@ethanwerner.com> | 2026-06-09 01:17:41 +0400 |
|---|---|---|
| committer | Ethan Werner <mail@ethanwerner.com> | 2026-06-09 01:17:41 +0400 |
| commit | 96ecf29e8be977f51f351308ef2c7c492bb829aa (patch) | |
| tree | c664aa61262e6f7627a732f0e4fbb84281b99952 /example/pool.c | |
| parent | f6a144987cc403de8ad6bddd055f756120f8d405 (diff) | |
refactor
Diffstat (limited to 'example/pool.c')
| -rw-r--r--[-rwxr-xr-x] | example/pool.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/example/pool.c b/example/pool.c index 8b1fafd..5c985e4 100755..100644 --- a/example/pool.c +++ b/example/pool.c @@ -1,7 +1,19 @@ +// pool.c - Example usage of pool.h memory pool + #define POOL_IMPLEMENTATION #include "../include/pool.h" -int main() { - pool_t*p = pool_init(10, 100); - pool_print(p); +#include <stdio.h> +#include <stdlib.h> + +int main(void) { + pool_t *p = pool_init(16, 100); + if (!p) { + fprintf(stderr, "Failed to initialize pool\n"); + return 1; + } + printf("capacity: %u\n", pool_capacity(p)); + printf("size: %u\n", pool_size(p)); + pool_fini(&p); + return 0; }
\ No newline at end of file |