|
From: <sv...@va...> - 2008-10-15 14:04:42
|
Author: sewardj
Date: 2008-10-15 13:10:11 +0100 (Wed, 15 Oct 2008)
New Revision: 8671
Log:
Print a reasonable error message (like Memcheck) when running out of
memory, instead of asserting.
Modified:
branches/YARD/helgrind/libhb_core.c
Modified: branches/YARD/helgrind/libhb_core.c
===================================================================
--- branches/YARD/helgrind/libhb_core.c 2008-10-13 19:22:35 UTC (rev 8670)
+++ branches/YARD/helgrind/libhb_core.c 2008-10-15 12:10:11 UTC (rev 8671)
@@ -358,6 +358,9 @@
VG_(printf)("XXXXX bigchunk: abandoning %d bytes\n",
(Int)(shmem__bigchunk_end1 - shmem__bigchunk_next));
shmem__bigchunk_next = VG_(am_shadow_alloc)( sHMEM__BIGCHUNK_SIZE );
+ if (shmem__bigchunk_next == NULL)
+ VG_(out_of_memory_NORETURN)(
+ "helgrind:shmem__bigchunk_alloc", sHMEM__BIGCHUNK_SIZE );
shmem__bigchunk_end1 = shmem__bigchunk_next + sHMEM__BIGCHUNK_SIZE;
}
tl_assert(shmem__bigchunk_next);
|