Improve configuration of custom JSC
Reviewed By: amnn Differential Revision: D4237462 fbshipit-source-id: ef16b7f81d3158c63a12e32e2e35204635a57543
This commit is contained in:
parent
ebc65cecd6
commit
118e981174
|
@ -51,6 +51,10 @@ static const JSCWrapper* s_customWrapper = nullptr;
|
|||
|
||||
static JSCWrapper s_systemWrapper = {};
|
||||
|
||||
bool isCustomJSCWrapperSet() {
|
||||
return s_customWrapper != nullptr;
|
||||
}
|
||||
|
||||
const JSCWrapper* customJSCWrapper() {
|
||||
#if USE_GLOG
|
||||
CHECK(s_customWrapper != nullptr) << "Accessing custom JSC wrapper before it's set";
|
||||
|
@ -60,7 +64,6 @@ const JSCWrapper* customJSCWrapper() {
|
|||
|
||||
void setCustomJSCWrapper(const JSCWrapper* wrapper) {
|
||||
#if USE_GLOG
|
||||
CHECK(wrapper != nullptr) << "Can't set null wrapper";
|
||||
CHECK(s_customWrapper == nullptr) << "Can't set custom JSC wrapper multiple times";
|
||||
#endif
|
||||
s_customWrapper = wrapper;
|
||||
|
|
|
@ -127,6 +127,7 @@ bool isCustomJSCPtr(T *x) {
|
|||
return (uintptr_t)x & 0x1;
|
||||
}
|
||||
|
||||
bool isCustomJSCWrapperSet();
|
||||
void setCustomJSCWrapper(const JSCWrapper* wrapper);
|
||||
|
||||
// This will return a single value for the whole life of the process.
|
||||
|
|
Loading…
Reference in New Issue