Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ MyWrap* MyWrap::New(Environment* env, v8::Local<v8::Object> object) {
// pointer with this, as this is not managed by the native memory
// allocator but by V8.
return cppgc::MakeGarbageCollected<MyWrap>(
env->isolate()->GetCppHeap()->GetAllocationHandle(), env, object);
env->cppgc_allocation_handle(), env, object);
}

// Binding method to be invoked by JavaScript.
Expand Down
4 changes: 4 additions & 0 deletions src/env-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ inline v8::Isolate* Environment::isolate() const {
return isolate_;
}

inline cppgc::AllocationHandle& Environment::cppgc_allocation_handle() const {
return isolate_->GetCppHeap()->GetAllocationHandle();
}

inline v8::ExternalMemoryAccounter* Environment::external_memory_accounter()
const {
return external_memory_accounter_;
Expand Down
1 change: 1 addition & 0 deletions src/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ class Environment final : public MemoryRetainer {
void StartProfilerIdleNotifier();

inline v8::Isolate* isolate() const;
inline cppgc::AllocationHandle& cppgc_allocation_handle() const;
inline v8::ExternalMemoryAccounter* external_memory_accounter() const;
inline uv_loop_t* event_loop() const;
void TryLoadAddon(const char* filename,
Expand Down
8 changes: 2 additions & 6 deletions src/node_contextify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,7 @@ ContextifyContext* ContextifyContext::New(Local<Context> v8_context,
}
DCHECK_NOT_NULL(env->isolate()->GetCppHeap());
result = cppgc::MakeGarbageCollected<ContextifyContext>(
env->isolate()->GetCppHeap()->GetAllocationHandle(),
env,
wrapper,
v8_context,
options);
env->cppgc_allocation_handle(), env, wrapper, v8_context, options);
}

Local<Object> wrapper_holder =
Expand Down Expand Up @@ -975,7 +971,7 @@ ContextifyScript* ContextifyScript::New(Environment* env,
Local<Object> object) {
DCHECK_NOT_NULL(env->isolate()->GetCppHeap());
return cppgc::MakeGarbageCollected<ContextifyScript>(
env->isolate()->GetCppHeap()->GetAllocationHandle(), env, object);
env->cppgc_allocation_handle(), env, object);
}

void ContextifyScript::New(const FunctionCallbackInfo<Value>& args) {
Expand Down
Loading