Changeset b81fd95 for libcfa/src/stdlib.hfa
- Timestamp:
- Jul 29, 2020, 11:29:01 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 0c760db
- Parents:
- 1d17939
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/stdlib.hfa
r1d17939 rb81fd95 232 232 size_t osize = malloc_size( ptr ); // current allocation 233 233 size_t nsize = dim * sizeof(T); // new allocation 234 T * nptr = realloc( ptr, align, nsize ); // CFA realloc234 T * nptr = alloc_align( ptr, align, nsize ); // CFA alloc_align 235 235 if ( nsize > osize ) { // larger ? 236 236 memset( (char *)nptr + osize, (int)fill, nsize - osize ); // initialize added storage … … 243 243 size_t nsize = dim * sizeof(T); // new allocation 244 244 size_t ndim = nsize / sizeof(T); // new dimension 245 T * nptr = realloc( ptr, align, nsize ); // CFA realloc245 T * nptr = alloc_align( ptr, align, nsize ); // CFA alloc_align 246 246 if ( ndim > odim ) { // larger ? 247 247 for ( i; odim ~ ndim ) {
Note: See TracChangeset
for help on using the changeset viewer.