зеркало из https://github.com/mozilla/pjs.git
Bug 734976 - Call js_ReportOutOfMemory in jsgcinlines when simulating OOM. Original patch by Brian Hackett. r=luke,bhackett,jdemooij
This commit is contained in:
Родитель
e38f636fa8
Коммит
781fdef9c1
|
@ -158,9 +158,20 @@ PrintBacktrace()
|
|||
} \
|
||||
} while (0)
|
||||
|
||||
# define JS_OOM_POSSIBLY_FAIL_REPORT(cx) \
|
||||
do \
|
||||
{ \
|
||||
if (++OOM_counter > OOM_maxAllocations) { \
|
||||
JS_OOM_EMIT_BACKTRACE();\
|
||||
js_ReportOutOfMemory(cx);\
|
||||
return NULL; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
# else
|
||||
# define JS_OOM_POSSIBLY_FAIL() do {} while(0)
|
||||
# endif
|
||||
# define JS_OOM_POSSIBLY_FAIL_REPORT(cx) do {} while(0)
|
||||
# endif /* DEBUG */
|
||||
|
||||
/*
|
||||
* SpiderMonkey code should not be calling these allocation functions directly.
|
||||
|
|
|
@ -440,7 +440,7 @@ NewGCThing(JSContext *cx, js::gc::AllocKind kind, size_t thingSize)
|
|||
JS_ASSERT(!cx->runtime->noGCOrAllocationCheck);
|
||||
|
||||
/* For testing out of memory conditions */
|
||||
JS_OOM_POSSIBLY_FAIL();
|
||||
JS_OOM_POSSIBLY_FAIL_REPORT(cx);
|
||||
|
||||
#ifdef JS_GC_ZEAL
|
||||
if (cx->runtime->needZealousGC())
|
||||
|
|
Загрузка…
Ссылка в новой задаче