Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions embedding/embedding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ bool ReportAndClearException(JSContext *cx) {
return true;
}

void *LAST_SBRK;
void *LAST_SBRK = nullptr;
JS::PersistentRootedObject AB;
static bool GetMemBuffer(JSContext *cx, unsigned argc, JS::Value *vp) {
if (sbrk(0) != LAST_SBRK) {
Expand All @@ -502,7 +502,7 @@ static bool GetMemBuffer(JSContext *cx, unsigned argc, JS::Value *vp) {
#endif
JS::RootedObject mem_buffer(cx, JS::NewArrayBufferWithUserOwnedContents(
cx, (size_t)LAST_SBRK, base));
AB.init(cx, mem_buffer);
AB.set(mem_buffer);
}
JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
args.rval().setObject(*AB);
Expand All @@ -512,6 +512,7 @@ static bool GetMemBuffer(JSContext *cx, unsigned argc, JS::Value *vp) {
bool install(api::Engine *engine) {
Runtime.engine = engine;
Runtime.cx = engine->cx();
AB.init(engine->cx());

char env_name[100];

Expand Down
Loading