Annotation of parser3/src/main/pa_memory.C, revision 1.11

1.2       paf         1: /** @file
                      2:        Parser: memory reference counting classes.
                      3: 
1.11    ! moko        4:        Copyright (c) 2001-2015 Art. Lebedev Studio (http://www.artlebedev.com)
1.2       paf         5:        Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
                      6: */
                      7: 
                      8: #include "pa_sapi.h"
                      9: #include "pa_common.h"
                     10: 
1.11    ! moko       11: volatile const char * IDENT_PA_MEMORY_C="$Id: pa_memory.C,v 1.10 2013/07/23 15:39:10 moko Exp $" IDENT_PA_MEMORY_H;
1.9       moko       12: 
1.2       paf        13: void *pa_fail_alloc(const char* what, size_t size) {
                     14: #ifdef PA_DEBUG_DISABLE_GC
                     15:        SAPI::die("out of memory (in pa_fail_alloc)");
                     16: #else
                     17:        SAPI::die("out of memory: failed to %s %u bytes. "
1.4       paf        18:                "heap_used=%u, heap_free=%u, bytes_since_gc=%u, total_bytes=%u",
1.2       paf        19:                what, size,
                     20:                GC_get_heap_size(),
                     21:                GC_get_free_bytes(),
                     22:                GC_get_bytes_since_gc(),
                     23:                GC_get_total_bytes()
                     24:                );
                     25: #endif
                     26:        // never reached
                     27:        return 0;
                     28: }

E-mail: