fix: NEW_OBJECT 走统一分配入口登记 epoch 对象消除属性向量泄漏

This commit is contained in:
2026-08-16 02:16:34 +08:00
parent 9013a07272
commit c8c6349fcc
2 changed files with 46 additions and 3 deletions
+1 -3
View File
@@ -227,9 +227,7 @@ impl Vm {
shape_id = self.kernel_core.shape_forge().make_shape(shape_id, si);
}
}
let obj = self
.epoch
.alloc(JsObject::new_empty(shape_id, JsValue::from_js_object(proto_ptr)));
let obj = self.alloc_object(JsObject::new_empty(shape_id, JsValue::from_js_object(proto_ptr)));
// 预分配数据槽并同步 generation:批量一次性 +nprops,与逐属性路径的终值一致。
let obj_ref = unsafe { &mut *obj };
for _ in 0..nprops {