Changeset 505450a


Ignore:
Timestamp:
Aug 15, 2020, 12:15:39 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
0fa04a04
Parents:
3b4750d
Message:

abort when memory check fails

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/heap.cfa

    r3b4750d r505450a  
    1010// Created On       : Tue Nov  6 17:54:56 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Aug  4 06:36:17 2020
    13 // Update Count     : 56
     12// Last Modified On : Sun Aug  9 08:05:16 2020
     13// Update Count     : 57
    1414//
    1515
     
    232232                size_t s = i + default_mmap_start();                    // cross over point
    233233                char * area = (char *)calloc( 1, s );
    234 //              if ( area == 0p ) abort( "calloc/realloc/free out of memory" );
    235234                if ( area[0] != '\0' || area[s - 1] != '\0' ||
    236235                         area[malloc_size( area ) - 1] != '\0' ||
    237                          ! malloc_zero_fill( area ) ) //abort( "calloc/realloc/free corrupt storage3" );
    238                         printf( "C %zd %d %d %d %d\n", s, area[0] != '\0', area[s - 1] != '\0', area[malloc_size( area ) - 1] != '\0', ! malloc_zero_fill( area ) );
     236                         ! malloc_zero_fill( area ) ) abort( "calloc/realloc/free corrupt storage3" );
    239237
    240238                // Do not start this loop index at 0 because realloc of 0 bytes frees the storage.
    241239                for ( r; i ~ 256 * 1024 ~ 26 ) {                                // start at initial memory request
    242240                        area = (char *)realloc( area, r );                      // attempt to reuse storage
    243 //                      if ( area == 0p ) abort( "calloc/realloc/free out of memory" );
    244241                        if ( area[0] != '\0' || area[r - 1] != '\0' ||
    245242                                 area[malloc_size( area ) - 1] != '\0' ||
     
    255252                // initial N byte allocation
    256253                char * area = (char *)memalign( a, amount );    // aligned N-byte allocation
    257 //              if ( area == 0p ) abort( "memalign/realloc/free out of memory" ); // no storage ?
    258254                //sout | alignments[a] | area;
    259255                if ( (size_t)area % a != 0 || malloc_alignment( area ) != a ) { // check for initial alignment
Note: See TracChangeset for help on using the changeset viewer.