Fix heap snapshots memory usage stats. Introduce estimateDirectMemoryUsageOf function in "bun:jsc" (#15790)

This commit is contained in:
Jarred Sumner
2024-12-16 20:16:23 -08:00
committed by GitHub
parent 3906d02e2c
commit aada6f930f
55 changed files with 1093 additions and 99 deletions

View File

@@ -47,6 +47,10 @@ pub const WTFStringImplStruct = extern struct {
return this.m_refCount / s_refCountIncrement;
}
pub fn memoryCost(this: WTFStringImpl) usize {
return this.byteLength();
}
pub fn isStatic(this: WTFStringImpl) bool {
return this.m_refCount & s_refCountIncrement != 0;
}