Commit dd40e9b3 authored by antma's avatar antma

don't output backtrace in out of memory case

parent 5de0d759
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#include "tools.h" #include "tools.h"
#ifdef DEBUG #ifdef DEBUG
#define RES_PRE 8
#define RES_AFTER 8
#define MAX_BLOCKS 1000000 #define MAX_BLOCKS 1000000
void *blocks[MAX_BLOCKS]; void *blocks[MAX_BLOCKS];
void *free_blocks[MAX_BLOCKS]; void *free_blocks[MAX_BLOCKS];
...@@ -37,18 +39,13 @@ int used_blocks; ...@@ -37,18 +39,13 @@ int used_blocks;
int free_blocks_cnt; int free_blocks_cnt;
#endif #endif
#ifdef DEBUG
#define RES_PRE 8
#define RES_AFTER 8
#endif
extern int verbosity; extern int verbosity;
long long total_allocated_bytes; long long total_allocated_bytes;
static void out_of_memory (void) { static void out_of_memory (void) {
logprintf ("Out of memory\n"); fprintf (stderr, "Out of memory\n");
assert (0 && "Out of memory"); exit (1);
} }
int tsnprintf (char *buf, int len, const char *format, ...) { int tsnprintf (char *buf, int len, const char *format, ...) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment