mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 23:58:20 +00:00
Installing a handler for running out of memory in "new".
Bro will now print an error message in that case rather than abort with an uncaught exception.
This commit is contained in:
parent
4c3be63919
commit
4da209d3b1
4 changed files with 18 additions and 2 deletions
|
@ -1383,7 +1383,13 @@ void safe_close(int fd)
|
|||
|
||||
void out_of_memory(const char* where)
|
||||
{
|
||||
reporter->FatalError("out of memory in %s.\n", where);
|
||||
fprintf(stderr, "out of memory in %s.\n", where);
|
||||
|
||||
if ( reporter )
|
||||
// Guess that might fail here if memory is really tight ...
|
||||
reporter->FatalError("out of memory in %s.\n", where);
|
||||
|
||||
abort();
|
||||
}
|
||||
|
||||
void get_memory_usage(unsigned int* total, unsigned int* malloced)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue