Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- 컴파일
- 안드로이드
- Realm
- ethereum
- 스탠바이미2후기
- Glide
- 스트리밍
- 스탠바이미2사용후기
- 스탠바이미2실사용
- C
- log
- convert
- 스탠바이미2총평
- test
- 스탠바이미2단점
- 스탠바이미2장점
- 다윈
- 가벼운갤럭시
- kotlin
- 닌텐도2
- Android
- Exception
- 스탠바이미2세대
- firebase
- error
- 닌텐도스위치2게임
- 닌텐도스위치2출시
- Gradle
- 스탠바이미2출시
- 스탠바이미2리뷰
Archives
- Today
- Total
날마다 새롭게 또 날마다 새롭게
alloc - 메모리 할당/해제 함수 구현 코드(stack, 포인터 연산) 본문
#define ALLOCSIZE 10000 /* size of available space */
static char allocbuf[ALLOCSIZE]; /* storage for alloc */
static char *allocp = allocbuf; /* next free position */
char *alloc(int n) /* return pointer to n characters */
{
if(allocbuf + ALLOCSIZE - allocp >= n)
{
allocp += n;
return allocp - n;
} else
return 0;
}
void afree(char *p)
{
if(p >= allocbuf && p < allocbuf + ALLOCSIZE)
allocp = p;
}