shithub: scc

ref: 4f0bf48999137e2429bab02829f1d34373d3f67a
dir: /src/libc/arch/amd64/darwin/_getheap.c/

View raw version
static char heap[16384];

void *
_getheap(void)
{
	return heap;
}

void *
_brk(void *addr)
{
	static char *cur = heap;
	char *p = addr;

	if (p < heap || p > &heap[sizeof(heap) - 1])
		return (void *)-1;
	return cur = p;
}