Changeset f67b983


Ignore:
Timestamp:
Sep 2, 2020, 8:37:54 AM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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
Message:

formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/stdlib.hfa

    rc86f587 rf67b983  
    1010// Created On       : Thu Jan 28 17:12:35 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Aug 14 23:38:50 2020
    13 // Update Count     : 504
     12// Last Modified On : Tue Sep  1 20:32:34 2020
     13// Update Count     : 505
    1414//
    1515
     
    4343//---------------------------------------
    4444
     45// Macro because of returns
    4546#define $ARRAY_ALLOC( allocation, alignment, dim ) \
    4647        if ( _Alignof(T) <= libAlign() ) return (T *)(void *)allocation( dim, (size_t)sizeof(T) ); /* C allocation */ \
     
    5152
    5253        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
    5455                else return (T *)memalign( _Alignof(T), sizeof(T) );
    5556        } // malloc
     
    176177                size_t size = sizeof(T);
    177178                size_t copy_end = 0;
    178                 if(Resize) {
     179
     180                if ( Resize ) {
    179181//printf("1. $alloc_internal got: %p %p %lu %lu\n", Resize, Realloc, Align, Dim); // these prints are temporary
    180182                        ptr = (T*) (void *) resize( (void *)Resize, Align, Dim * size );
    181                 } else if (Realloc) {
     183                } else if ( Realloc ) {
    182184                        if (Fill.tag != '0') copy_end = min(malloc_size( Realloc ), Dim * size);
    183185//printf("2. $alloc_internal got: %p %p %lu %lu\n", Resize, Realloc, Align, Dim);
Note: See TracChangeset for help on using the changeset viewer.