Bug 643548: Remove mozalloc_undef_macro_wrappers hack from JS engine. (r=luke,rs=brendan)
mozalloc_undef_macro_wrappers are brittle and have side-effects that are hard to debug and fix. The alternative is the just stick an underscore on the end of malloc, free, etc, which is a comparatively small burden.
This commit is contained in:
@@ -83,8 +83,8 @@ using namespace js;
|
||||
* MALLOC gets declared external, and that doesn't work for class members, so
|
||||
* wrap.
|
||||
*/
|
||||
inline void* dtoa_malloc(size_t size) { return OffTheBooks::malloc(size); }
|
||||
inline void dtoa_free(void* p) { return UnwantedForeground::free(p); }
|
||||
inline void* dtoa_malloc(size_t size) { return OffTheBooks::malloc_(size); }
|
||||
inline void dtoa_free(void* p) { return UnwantedForeground::free_(p); }
|
||||
|
||||
#define NO_GLOBAL_STATE
|
||||
#define MALLOC dtoa_malloc
|
||||
@@ -336,7 +336,7 @@ js_dtobasestr(DtoaState *state, int base, double dinput)
|
||||
JS_ASSERT(base >= 2 && base <= 36);
|
||||
|
||||
dval(d) = dinput;
|
||||
buffer = (char*) OffTheBooks::malloc(DTOBASESTR_BUFFER_SIZE);
|
||||
buffer = (char*) OffTheBooks::malloc_(DTOBASESTR_BUFFER_SIZE);
|
||||
if (!buffer)
|
||||
return NULL;
|
||||
p = buffer;
|
||||
@@ -380,7 +380,7 @@ js_dtobasestr(DtoaState *state, int base, double dinput)
|
||||
if (!b) {
|
||||
nomem1:
|
||||
Bfree(PASS_STATE b);
|
||||
UnwantedForeground::free(buffer);
|
||||
UnwantedForeground::free_(buffer);
|
||||
return NULL;
|
||||
}
|
||||
do {
|
||||
@@ -416,7 +416,7 @@ js_dtobasestr(DtoaState *state, int base, double dinput)
|
||||
if (mlo != mhi)
|
||||
Bfree(PASS_STATE mlo);
|
||||
Bfree(PASS_STATE mhi);
|
||||
UnwantedForeground::free(buffer);
|
||||
UnwantedForeground::free_(buffer);
|
||||
return NULL;
|
||||
}
|
||||
JS_ASSERT(e < 0);
|
||||
|
||||
Reference in New Issue
Block a user