void*tcc_realloc(void*ptr,unsignedlongsize){void*newptr;#ifdefMEM_DEBUGmem_cur_size -=malloc_usable_size(ptr);#endifnewptr =realloc(ptr, size);#ifdefMEM_DEBUG//NOTE:count not correct if alloc error, but not criticalmem_cur_size +=malloc_usable_size(newptr);if(mem_cur_size > mem_max...
exit(1);cstringnew_cstring_with_size(size_t n){cstring s=malloc((n+1)*sizeof(char));memset(s,0,n+1);if(!s){printf("new_cstring_with_size: ");NULL_PTR_ERROR}returns;}size_tcstring_size(cstring s){// 实际上有这么多空间可以用returnmalloc_usable_size(s)-1;} 然后测试这两个函数...