방금 the c programming language 라는 책에서
malloc() 이거 함수 구현하는것을 열심히 타이핑 했습니다. 그런데 sbrk()이함수는 UNIX 함수 호출이라고 나오네요.. windowsxp에서 sbrk()이런 역할을 하는 함수를 가르쳐 주세요..
#include<stdio.h>
#include<string.h>
#define NALLOC 1024
typedef long Align;
union header
{
struct {
union header *ptr;
unsigned size;
}s;
Align x;
};
typedef union header Header;
static Header base;
static Header *freep = NULL;
void free(void *ap)
{
Header *bp, *p;