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
- null safety
- vuepress
- 안드로이드
- 컴파일
- ethereum
- LAYER_TYPE_SOFTWARE
- porterduff
- coroutines
- Exception
- 스트리밍
- 다윈
- log
- Realm
- web3js
- C
- Hyperledger
- convert
- Android
- bigquery
- quick-start
- firebase
- dataginding
- Gradle
- hardwareacceleration
- kotlin
- fabric-sdk-java
- fabic
- error
- Glide
- test
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;
}
Comments