mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 825714 followup: Silence various warnings and make various style corrections. r=billm
This commit is contained in:
parent
d35081c114
commit
aa174a5dd7
@ -14,8 +14,6 @@
|
||||
#include "ion/Bailouts.h"
|
||||
#include "ion/VMFunctions.h"
|
||||
|
||||
#include "jscntxtinlines.h"
|
||||
|
||||
using namespace js;
|
||||
using namespace js::ion;
|
||||
|
||||
|
@ -467,13 +467,17 @@ class PerThreadData : public js::PerThreadDataFriendFields
|
||||
int gcAssertNoGCDepth;
|
||||
#endif
|
||||
|
||||
// If Ion code is on the stack, and has called into C++, this will be
|
||||
// aligned to an Ion exit frame.
|
||||
/*
|
||||
* If Ion code is on the stack, and has called into C++, this will be
|
||||
* aligned to an Ion exit frame.
|
||||
*/
|
||||
uint8_t *ionTop;
|
||||
JSContext *ionJSContext;
|
||||
uintptr_t ionStackLimit;
|
||||
|
||||
// This points to the most recent Ion activation running on the thread.
|
||||
/*
|
||||
* This points to the most recent Ion activation running on the thread.
|
||||
*/
|
||||
js::ion::IonActivation *ionActivation;
|
||||
|
||||
/*
|
||||
@ -1360,7 +1364,8 @@ VersionIsKnown(JSVersion version)
|
||||
}
|
||||
|
||||
inline void
|
||||
FreeOp::free_(void* p) {
|
||||
FreeOp::free_(void *p)
|
||||
{
|
||||
if (shouldFreeLater()) {
|
||||
runtime()->gcHelperThread.freeLater(p);
|
||||
return;
|
||||
@ -2300,4 +2305,46 @@ class ContextAllocPolicy
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
void *
|
||||
JSRuntime::malloc_(size_t bytes, JSCompartment *comp, JSContext *cx)
|
||||
{
|
||||
JS_ASSERT_IF(cx != NULL, cx->compartment == comp);
|
||||
updateMallocCounter(comp, bytes);
|
||||
void *p = js_malloc(bytes);
|
||||
return JS_LIKELY(!!p) ? p : onOutOfMemory(NULL, bytes, cx);
|
||||
}
|
||||
|
||||
void *
|
||||
JSRuntime::calloc_(size_t bytes, JSCompartment *comp, JSContext *cx)
|
||||
{
|
||||
JS_ASSERT_IF(cx != NULL, cx->compartment == comp);
|
||||
updateMallocCounter(comp, bytes);
|
||||
void *p = js_calloc(bytes);
|
||||
return JS_LIKELY(!!p) ? p : onOutOfMemory(reinterpret_cast<void *>(1), bytes, cx);
|
||||
}
|
||||
|
||||
void *
|
||||
JSRuntime::realloc_(void *p, size_t oldBytes, size_t newBytes, JSCompartment *comp, JSContext *cx)
|
||||
{
|
||||
JS_ASSERT_IF(cx != NULL, cx->compartment == comp);
|
||||
JS_ASSERT(oldBytes < newBytes);
|
||||
updateMallocCounter(comp, newBytes - oldBytes);
|
||||
void *p2 = js_realloc(p, newBytes);
|
||||
return JS_LIKELY(!!p2) ? p2 : onOutOfMemory(p, newBytes, cx);
|
||||
}
|
||||
|
||||
void *
|
||||
JSRuntime::realloc_(void *p, size_t bytes, JSCompartment *comp, JSContext *cx)
|
||||
{
|
||||
JS_ASSERT_IF(cx != NULL, cx->compartment == comp);
|
||||
/*
|
||||
* For compatibility we do not account for realloc that increases
|
||||
* previously allocated memory.
|
||||
*/
|
||||
if (!p)
|
||||
updateMallocCounter(comp, bytes);
|
||||
void *p2 = js_realloc(p, bytes);
|
||||
return JS_LIKELY(!!p2) ? p2 : onOutOfMemory(p, bytes, cx);
|
||||
}
|
||||
|
||||
#endif /* jscntxt_h___ */
|
||||
|
@ -22,44 +22,6 @@
|
||||
|
||||
#include "jsgcinlines.h"
|
||||
|
||||
void*
|
||||
JSRuntime::malloc_(size_t bytes, JSCompartment *comp, JSContext *cx) {
|
||||
JS_ASSERT_IF(cx != NULL, cx->compartment == comp);
|
||||
updateMallocCounter(comp, bytes);
|
||||
void *p = js_malloc(bytes);
|
||||
return JS_LIKELY(!!p) ? p : onOutOfMemory(NULL, bytes, cx);
|
||||
}
|
||||
|
||||
void*
|
||||
JSRuntime::calloc_(size_t bytes, JSCompartment *comp, JSContext *cx) {
|
||||
JS_ASSERT_IF(cx != NULL, cx->compartment == comp);
|
||||
updateMallocCounter(comp, bytes);
|
||||
void *p = js_calloc(bytes);
|
||||
return JS_LIKELY(!!p) ? p : onOutOfMemory(reinterpret_cast<void *>(1), bytes, cx);
|
||||
}
|
||||
|
||||
void*
|
||||
JSRuntime::realloc_(void* p, size_t oldBytes, size_t newBytes, JSCompartment *comp, JSContext *cx) {
|
||||
JS_ASSERT_IF(cx != NULL, cx->compartment == comp);
|
||||
JS_ASSERT(oldBytes < newBytes);
|
||||
updateMallocCounter(comp, newBytes - oldBytes);
|
||||
void *p2 = js_realloc(p, newBytes);
|
||||
return JS_LIKELY(!!p2) ? p2 : onOutOfMemory(p, newBytes, cx);
|
||||
}
|
||||
|
||||
void*
|
||||
JSRuntime::realloc_(void* p, size_t bytes, JSCompartment *comp, JSContext *cx) {
|
||||
JS_ASSERT_IF(cx != NULL, cx->compartment == comp);
|
||||
/*
|
||||
* For compatibility we do not account for realloc that increases
|
||||
* previously allocated memory.
|
||||
*/
|
||||
if (!p)
|
||||
updateMallocCounter(comp, bytes);
|
||||
void *p2 = js_realloc(p, bytes);
|
||||
return JS_LIKELY(!!p2) ? p2 : onOutOfMemory(p, bytes, cx);
|
||||
}
|
||||
|
||||
namespace js {
|
||||
|
||||
inline void
|
||||
|
@ -9,8 +9,6 @@
|
||||
|
||||
#include "js/CharacterEncoding.h"
|
||||
|
||||
#include "jscntxtinlines.h"
|
||||
|
||||
using namespace JS;
|
||||
|
||||
Latin1CharsZ
|
||||
|
Loading…
Reference in New Issue
Block a user