aboutsummaryrefslogtreecommitdiff
path: root/lib/mlibc/tests/linux/malloc-usable-size.c
blob: 3bb0394f1868b8e0167aae962470e8d93364a15a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <assert.h>
#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>

int main() {
	void *p1 = malloc(1023);
	fprintf(stderr, "size: %zu\n", malloc_usable_size(p1));
	assert(malloc_usable_size(p1) >= 1023);
	free(p1);

	return 0;
}