Comment 17 for bug 429476

Revision history for this message
In , Igor Bukanov (igor-mir2) wrote :

Comment on attachment 401579
Patch

>diff -r 7e985a173416 -r 892ea3ad67be js/src/jsapi.cpp
>--- a/js/src/jsapi.cpp Fri Sep 18 14:27:07 2009 -0700
>+++ b/js/src/jsapi.cpp Fri Sep 18 17:33:53 2009 -0700
>@@ -2626,6 +2626,7 @@
> if (!str)
> return NULL;
> str->initFlat(chars, length);
>+ cx->runtime->gcMallocBytes += length * sizeof(jschar);
> return str;

This is not thread-safe. Use cx->updateMallocCounter(size) here. r+ with that fixed. Also it would be nice to have a a diff with -p -U8.