Changeset c86f587
- Timestamp:
- Sep 2, 2020, 8:36:50 AM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- f67b983
- Parents:
- 4557bcf7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/heap.cfa
r4557bcf7 rc86f587 10 10 // Created On : Tue Dec 19 21:58:35 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Aug 24 20:29:24202013 // Update Count : 92 612 // Last Modified On : Tue Sep 1 21:58:36 2020 13 // Update Count : 927 14 14 // 15 15 … … 1218 1218 #endif // __STATISTICS__ 1219 1219 1220 // If size is equal to 0, either NULL or a pointer suitable to be passed to free() is returned.1221 if ( unlikely( size == 0 ) ) { free( oaddr ); return 0p; } // special cases1222 if ( unlikely( oaddr == 0p ) ) {1223 #ifdef __STATISTICS__1224 __atomic_add_fetch( &resize_storage, size, __ATOMIC_SEQ_CST );1225 #endif // __STATISTICS__1226 return memalignNoStats( nalign, size );1227 } // if1228 1229 1220 if ( unlikely( nalign < libAlign() ) ) nalign = libAlign(); // reset alignment to minimum 1230 1221 #ifdef __CFA_DEBUG__ … … 1232 1223 checkAlign( nalign ); // check alignment 1233 1224 #endif // __CFA_DEBUG__ 1225 1226 // If size is equal to 0, either NULL or a pointer suitable to be passed to free() is returned. 1227 if ( unlikely( size == 0 ) ) { free( oaddr ); return 0p; } // special cases 1228 if ( unlikely( oaddr == 0p ) ) { 1229 #ifdef __STATISTICS__ 1230 __atomic_add_fetch( &resize_storage, size, __ATOMIC_SEQ_CST ); 1231 #endif // __STATISTICS__ 1232 return memalignNoStats( nalign, size ); 1233 } // if 1234 1234 1235 1235 HeapManager.Storage.Header * header; … … 1267 1267 #endif // __CFA_DEBUG__ 1268 1268 1269 // If size is equal to 0, either NULL or a pointer suitable to be passed to free() is returned. 1270 if ( unlikely( size == 0 ) ) { free( oaddr ); return 0p; } // special cases 1271 if ( unlikely( oaddr == 0p ) ) { 1272 #ifdef __STATISTICS__ 1273 __atomic_add_fetch( &realloc_calls, 1, __ATOMIC_SEQ_CST ); 1274 __atomic_add_fetch( &realloc_storage, size, __ATOMIC_SEQ_CST ); 1275 #endif // __STATISTICS__ 1276 return memalignNoStats( nalign, size ); 1277 } // if 1278 1269 1279 HeapManager.Storage.Header * header; 1270 1280 HeapManager.FreeHeader * freeElem; … … 1286 1296 #endif // __STATISTICS__ 1287 1297 1288 // If size is equal to 0, either NULL or a pointer suitable to be passed to free() is returned.1289 if ( unlikely( size == 0 ) ) { free( oaddr ); return 0p; } // special cases1290 if ( unlikely( oaddr == 0p ) ) return memalignNoStats( nalign, size );1291 1292 1298 size_t osize = header->kind.real.size; // old allocation size 1293 1299 bool ozfill = (header->kind.real.blockSize & 2) != 0; // old allocation zero filled
Note: See TracChangeset
for help on using the changeset viewer.