Changeset f67b983
- Timestamp:
- Sep 2, 2020, 8:37:54 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:
- da5f7de
- Parents:
- c86f587
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/stdlib.hfa
rc86f587 rf67b983 10 10 // Created On : Thu Jan 28 17:12:35 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Aug 14 23:38:50202013 // Update Count : 50 412 // Last Modified On : Tue Sep 1 20:32:34 2020 13 // Update Count : 505 14 14 // 15 15 … … 43 43 //--------------------------------------- 44 44 45 // Macro because of returns 45 46 #define $ARRAY_ALLOC( allocation, alignment, dim ) \ 46 47 if ( _Alignof(T) <= libAlign() ) return (T *)(void *)allocation( dim, (size_t)sizeof(T) ); /* C allocation */ \ … … 51 52 52 53 T * malloc( void ) { 53 if ( _Alignof(T) <= libAlign() ) return (T *)(void *)malloc( (size_t)sizeof(T) ); / * C allocation */54 if ( _Alignof(T) <= libAlign() ) return (T *)(void *)malloc( (size_t)sizeof(T) ); // C allocation 54 55 else return (T *)memalign( _Alignof(T), sizeof(T) ); 55 56 } // malloc … … 176 177 size_t size = sizeof(T); 177 178 size_t copy_end = 0; 178 if(Resize) { 179 180 if ( Resize ) { 179 181 //printf("1. $alloc_internal got: %p %p %lu %lu\n", Resize, Realloc, Align, Dim); // these prints are temporary 180 182 ptr = (T*) (void *) resize( (void *)Resize, Align, Dim * size ); 181 } else if ( Realloc) {183 } else if ( Realloc ) { 182 184 if (Fill.tag != '0') copy_end = min(malloc_size( Realloc ), Dim * size); 183 185 //printf("2. $alloc_internal got: %p %p %lu %lu\n", Resize, Realloc, Align, Dim);
Note: See TracChangeset
for help on using the changeset viewer.