Changeset 38cc59f for libcfa/src


Ignore:
Timestamp:
Oct 13, 2022, 5:05:23 PM (2 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master
Children:
f82f07e
Parents:
481f882 (diff), 7671c6d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/heap.cfa

    r481f882 r38cc59f  
    1010// Created On       : Tue Dec 19 21:58:35 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Oct 11 15:08:33 2022
    13 // Update Count     : 1525
     12// Last Modified On : Wed Oct 12 18:06:01 2022
     13// Update Count     : 1528
    1414//
    1515
     
    453453
    454454
    455 #define NO_MEMORY_MSG "insufficient heap memory available to allocate %zd new bytes."
     455#define NO_MEMORY_MSG "**** Error **** insufficient heap memory available to allocate %zd new bytes."
    456456
    457457Heap * getHeap() with( heapMaster ) {
     
    477477                                if ( errno == ENOMEM ) abort( NO_MEMORY_MSG, size ); // no memory
    478478                                // Do not call strerror( errno ) as it may call malloc.
    479                                 abort( "attempt to allocate block of heaps of size %zu bytes and mmap failed with errno %d.", size, errno );
     479                                abort( "**** Error **** attempt to allocate block of heaps of size %zu bytes and mmap failed with errno %d.", size, errno );
    480480                        } // if
    481481                        heapManagersStorageEnd = &heapManagersStorage[HeapDim]; // outside array
     
    835835                if ( unlikely( sbrk( increase ) == (void *)-1 ) ) {     // failed, no memory ?
    836836                        unlock( extLock );
    837                         __cfaabi_bits_print_nolock( STDERR_FILENO, NO_MEMORY_MSG, size );
    838                         _exit( EXIT_FAILURE );                                          // give up
    839                 } // if
     837                        abort( NO_MEMORY_MSG, size );                           // no memory
     838                } // if
     839
     840                // Make storage executable for thunks.
     841                if ( mprotect( (char *)heapEnd + heapRemaining, increase, __map_prot ) ) {
     842                        unlock( extLock );
     843                        abort( "**** Error **** attempt to make heap storage executable for thunks and mprotect failed with errno %d.", errno );
     844                } // if
     845
    840846                rem = heapRemaining + increase - size;
    841847
Note: See TracChangeset for help on using the changeset viewer.