~jkaivo/mapalloc

624ac93ac5673cf88a426de054d36c61503c1779 — Jakob Kaivo 2 years ago bd7dee4
add a third round that forces new allocation
1 files changed, 5 insertions(+), 1 deletions(-)

M test/realloc.c
M test/realloc.c => test/realloc.c +5 -1
@@ 13,6 13,10 @@ int main(void)
	printf("%p: %s\n", ptr, ptr);

	ptr = map_realloc(ptr, sizeof(buf) * 2);
	memcpy(ptr + sizeof(buf), buf, sizeof(buf));
	memcpy(ptr + sizeof(buf) - 1, buf, sizeof(buf));
	printf("%p: %s\n", ptr, ptr);

	ptr = map_realloc(ptr, sizeof(buf) * sysconf(_SC_PAGESIZE));
	memcpy(ptr + (2 * sizeof(buf)) - 2, buf, sizeof(buf));
	printf("%p: %s\n", ptr, ptr);
}