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

1.1.2.1   paf         1: /** @file
                      2:        Parser: memory reference counting classes.
                      3: 
                      4:        Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com)
                      5:        Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
                      6: */
                      7: 
1.1.2.5.2.4! paf         8: static const char* IDENT_MEMORY_C="$Date: 2003/03/20 13:09:54 $";
1.1.2.1   paf         9: 
                     10: #include "pa_sapi.h"
1.1.2.5.2.4! paf        11: #include "pa_common.h"
1.1.2.5   paf        12: 
1.1.2.5.2.2  paf        13: void *pa_fail_alloc(const char* what, size_t size) {
1.1.2.5.2.3  paf        14:        SAPI::abort("out of memory: failed to %s %u bytes. "
                     15:                "heap_used=%lu, heap_free=%lu, bytes_since_gc=%lu, total_bytes=%lu",
                     16:                what, size,
                     17:                GC_get_heap_size(),
                     18:                GC_get_free_bytes(),
                     19:                GC_get_bytes_since_gc(),
                     20:                GC_get_total_bytes()
                     21:                );
1.1.2.1   paf        22: 
                     23:        // never reached
                     24:        return 0;
                     25: }
1.1.2.5.2.4! paf        26: 
        !            27: 
        !            28: char* pa_format_integer(int value) {
        !            29:        char local[MAX_NUMBER];
        !            30:        return pa_strdup(local, snprintf(local, MAX_NUMBER, "%d", value));
        !            31: };

E-mail: