diff options
Diffstat (limited to 'lib/liballoc/src/test.c')
| -rw-r--r-- | lib/liballoc/src/test.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/liballoc/src/test.c b/lib/liballoc/src/test.c new file mode 100644 index 0000000..7b3ee44 --- /dev/null +++ b/lib/liballoc/src/test.c @@ -0,0 +1,22 @@ +#include "allocator.h" + +#include <err.h> +#include <string.h> +#include <stdlib.h> + +const struct allocator *ga = &stdlib_heap_allocator; + +int +main(int argc, const char **argv) +{ + struct test *test; + int rc; + + if (argc <= 1) exit(1); + + test = ga->alloc(ga, strtoull(argv[1], NULL, 10), &rc); + if (!test) errx(1, "alloc: %s", strerror(rc)); + + rc = ga->free(ga, test); + if (rc) errx(1, "free: %s", strerror(rc)); +} |
