Fix js_AllocStack to null new space (cheapest way to save last-ditch GC from scanning uninitialized stack space; 290476, r=shaver, a=me).

This commit is contained in:
brendan%mozilla.org 2005-04-15 16:01:20 +00:00
parent 20572e768b
commit 743092df0c

View File

@ -407,6 +407,12 @@ js_AllocStack(JSContext *cx, uintN nslots, void **markp)
sp += 2;
}
/*
* Store JSVAL_NULL using memset, to let compilers optimize as they see
* fit, in case a caller allocates and pushes GC-things one by one, which
* could nest a last-ditch GC that will scan this segment.
*/
memset(sp, 0, nslots * sizeof(jsval));
return sp;
}