Fix non-threadsafe builds, no bug. r=jorendorff

This commit is contained in:
Brian Hackett 2012-01-11 07:45:55 -08:00
parent 16a8066bb0
commit ea3261837a
3 changed files with 9 additions and 9 deletions

View File

@ -183,6 +183,8 @@ struct IterateData
DestroyNameCallback destroyNameCb;
};
#ifdef JS_THREADSAFE
extern JS_PUBLIC_API(bool)
CollectCompartmentStatsForRuntime(JSRuntime *rt, IterateData *data);
@ -190,6 +192,8 @@ extern JS_PUBLIC_API(bool)
GetExplicitNonHeapForRuntime(JSRuntime *rt, int64_t *amount,
JSMallocSizeOfFun mallocSizeOf);
#endif /* JS_THREADSAFE */
extern JS_PUBLIC_API(void)
SizeOfCompartmentTypeInferenceData(JSContext *cx, JSCompartment *compartment,
TypeInferenceMemoryStats *stats,

View File

@ -48,6 +48,8 @@
#include "jsobjinlines.h"
#ifdef JS_THREADSAFE
namespace JS {
using namespace js;
@ -223,10 +225,6 @@ CollectCompartmentStatsForRuntime(JSRuntime *rt, IterateData *data)
rt->atomState.atoms.sizeOfExcludingThis(data->mallocSizeOf);
{
#ifndef JS_THREADSAFE
#error "This code assumes JS_THREADSAFE is defined"
#endif
// Need the GC lock to call JS_ContextIteratorUnlocked() and to
// access rt->threads.
AutoLockGC lock(rt);
@ -349,10 +347,6 @@ GetExplicitNonHeapForRuntime(JSRuntime *rt, int64_t *amount,
*amount += n;
{
#ifndef JS_THREADSAFE
#error "This code assumes JS_THREADSAFE is defined"
#endif
// Need the GC lock to call JS_ContextIteratorUnlocked() and to
// access rt->threads.
AutoLockGC lock(rt);
@ -380,3 +374,5 @@ GetExplicitNonHeapForRuntime(JSRuntime *rt, int64_t *amount,
}
} // namespace JS
#endif // JS_THREADSAFE

View File

@ -144,7 +144,7 @@ extern JSBool js_IsRuntimeLocked(JSRuntime *rt);
#define JS_ATOMIC_ADD(p,v) (*(p) += (v))
#define JS_ATOMIC_SET(p,v) (*(p) = (v))
#define js_CurrentThreadId() 0
#define js_CurrentThreadId() ((void*)NULL)
#define JS_NEW_LOCK() NULL
#define JS_DESTROY_LOCK(l) ((void)0)
#define JS_ACQUIRE_LOCK(l) ((void)0)