cppgc: Provide API to test if object is marked or freed
This is needed to support minor gc tests on the Blink side. Bug: chromium:1029379 Change-Id: Ic7ce1ae8e626b87738d76663ceecf7198e425d18 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3437050 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Anton Bikineev <bikineev@chromium.org> Auto-Submit: Anton Bikineev <bikineev@chromium.org> Cr-Commit-Position: refs/heads/main@{#78943}
This commit is contained in:
parent
fca5a7f350
commit
4c2b5f4d30
@ -93,6 +93,8 @@ class V8_EXPORT StandaloneTestingHeap final {
|
||||
HeapHandle& heap_handle_;
|
||||
};
|
||||
|
||||
V8_EXPORT bool IsHeapObjectOld(void*);
|
||||
|
||||
} // namespace testing
|
||||
} // namespace cppgc
|
||||
|
||||
|
@ -54,5 +54,13 @@ void StandaloneTestingHeap::ForceCompactionForNextGarbageCollection() {
|
||||
.EnableForNextGCForTesting();
|
||||
}
|
||||
|
||||
bool IsHeapObjectOld(void* object) {
|
||||
#if defined(CPPGC_YOUNG_GENERATION)
|
||||
return internal::HeapObjectHeader::FromObject(object).IsMarked();
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace testing
|
||||
} // namespace cppgc
|
||||
|
Loading…
Reference in New Issue
Block a user