don't output backtrace in out of memory case
This commit is contained in:
parent
5de0d75942
commit
dd40e9b36f
11
tools.c
11
tools.c
@ -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;
|
|||||||
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, ...) {
|
||||||
|
Loading…
Reference in New Issue
Block a user