blob: 7b3ee443a9b586f7a4fd31c55e44230fed09412e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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));
}
|