Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 0b48399

Browse files
committed
Bug 1735296 - Part 1: Use HeapPtrObject in NonshrinkingGCObjectVector r=sfink
With the following patches, this lets us remove public GCPolicy APIs for sweeping raw pointers. Differential Revision: https://phabricator.services.mozilla.com/D128257
1 parent 73383ab commit 0b48399

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

js/src/shell/jsshell.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,11 @@ bool CreateAlias(JSContext* cx, const char* dstName,
173173
enum class ScriptKind { Script, ScriptStencil, DecodeScript, Module };
174174

175175
class NonshrinkingGCObjectVector
176-
: public GCVector<JSObject*, 0, SystemAllocPolicy> {
176+
: public GCVector<HeapPtrObject, 0, SystemAllocPolicy> {
177177
public:
178178
void sweep() {
179-
for (JSObject*& obj : *this) {
180-
if (JS::GCPolicy<JSObject*>::needsSweep(&obj)) {
179+
for (HeapPtrObject& obj : *this) {
180+
if (JS::GCPolicy<HeapPtrObject>::needsSweep(&obj)) {
181181
obj = nullptr;
182182
}
183183
}

0 commit comments

Comments
 (0)