Changeset 664
- Timestamp:
- Mar 22, 2006, 6:34:03 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/kernel/kernel.c
r652 r664 56 56 { 57 57 uint32_t *p = freemem; 58 if(!size) 59 return NULL; 58 60 size = (size + 0x7) / 4; 59 61 *p = size; … … 69 71 void *realloc(void *ptr, size_t size) 70 72 { 71 uint32_t oldsize = ((uint32_t *)ptr)[-1];73 uint32_t oldsize; 72 74 void *p; 73 if(oldsize >= size) 74 return ptr; 75 76 if(!size) 77 return NULL; 78 79 if(!ptr) 80 oldsize = 0; 81 else 82 { 83 oldsize = ((uint32_t *)ptr)[-1]; 84 if(oldsize >= size) 85 return ptr; 86 } 75 87 76 88 p = malloc(size);
Note: See TracChangeset
for help on using the changeset viewer.