Changeset 454 for trunk/src/sh_mem.c
- Timestamp:
- Jun 29, 2014, 7:30:04 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_mem.c
r292 r454 142 142 while (this != NULL) 143 143 { 144 memlist_t * merr = (memlist_t *) malloc (sizeof(memlist_t));144 memlist_t * merr = calloc(1,sizeof(memlist_t)); 145 145 146 146 memcpy(merr, this, sizeof(memlist_t)); … … 191 191 if ( this->address == NULL ) 192 192 { 193 merr = (memlist_t *) malloc (sizeof(memlist_t));193 merr = calloc (1,sizeof(memlist_t)); 194 194 195 195 memcpy(merr, this, sizeof(memlist_t)); … … 204 204 if ( this->address[this->size] != CHECKBYTE ) 205 205 { 206 merr = (memlist_t *) malloc (sizeof(memlist_t));206 merr = calloc(1, sizeof(memlist_t)); 207 207 208 208 memcpy(merr, this, sizeof(memlist_t)); … … 215 215 if ( this->real_address[SH_MEMMULT-1] != CHECKBYTE ) 216 216 { 217 merr = (memlist_t *) malloc (sizeof(memlist_t));217 merr = calloc(1, sizeof(memlist_t)); 218 218 219 219 memcpy(merr, this, sizeof(memlist_t)); … … 262 262 SH_MUTEX_RECURSIVE_LOCK(mutex_mem); 263 263 264 the_realAddress = malloc(size + 2 * SH_MEMMULT);264 the_realAddress = calloc(1,size + 2 * SH_MEMMULT); 265 265 266 266 if ( the_realAddress == NULL ) … … 290 290 Mem_Max = ( (Mem_Current > Mem_Max) ? Mem_Current : Mem_Max); 291 291 292 this = (memlist_t *) malloc (sizeof(memlist_t));292 this = calloc(1,sizeof(memlist_t)); 293 293 294 294 if ( this == NULL) … … 370 370 if ( this->address[this->size] != CHECKBYTE ) 371 371 { 372 merr = (memlist_t *) malloc (sizeof(memlist_t));372 merr = calloc(1, sizeof(memlist_t)); 373 373 374 374 memcpy(merr, this, sizeof(memlist_t)); … … 381 381 if ( this->real_address[SH_MEMMULT-1] != CHECKBYTE ) 382 382 { 383 merr = (memlist_t *) malloc (sizeof(memlist_t));383 merr = calloc(1,sizeof(memlist_t)); 384 384 385 385 memcpy(merr, this, sizeof(memlist_t)); … … 454 454 SL_ENTER(_("sh_mem_malloc")); 455 455 456 theAddress = malloc(size);456 theAddress = calloc(1,size); 457 457 458 458 if ( theAddress != NULL )
Note:
See TracChangeset
for help on using the changeset viewer.