有谁帮我分析下这个程序,谢谢。 #define HEAPEND 0x33ff0000 extern char Image$$RW$$Limit[]; void *mallocPt=Image$$RW$$Limit; unsigned short *rxdata; ------------------------------------------- rxdata = (unsigned short *)malloc(0x80000); 分配内存: void * malloc(unsigned nbyte) { void *returnPt = mallocPt; mallocPt = (int *)mallocPt+nbyte/4+((nbyte%4)>0); To align 4byte
if( (int)mallocPt > HEAPEND ) { mallocPt = returnPt; return NULL; } return returnPt; } 释放内存: void free(void *pt) { mallocPt = pt; }
|