Bug 230966 - GC may not know about memory used by AudioBufferSourceNode's buffer
Summary: GC may not know about memory used by AudioBufferSourceNode's buffer
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Audio (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-09-29 10:37 PDT by Chris Dumez
Modified: 2021-10-01 14:25 PDT (History)
15 users (show)

See Also:


Attachments
Patch (3.04 KB, patch)
2021-09-29 10:39 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (9.12 KB, patch)
2021-09-30 08:39 PDT, Chris Dumez
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (9.15 KB, patch)
2021-09-30 09:19 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (9.46 KB, patch)
2021-10-01 13:07 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2021-09-29 10:37:03 PDT
Have AudioBufferSourceNode report its buffer's memory for GC purposes, unless its buffer still has a JS wrapper (which already does report this memory).
Comment 1 Chris Dumez 2021-09-29 10:39:11 PDT
Created attachment 439623 [details]
Patch
Comment 2 Chris Dumez 2021-09-30 08:39:41 PDT
Created attachment 439740 [details]
Patch
Comment 3 Chris Dumez 2021-09-30 09:19:57 PDT
Created attachment 439743 [details]
Patch
Comment 4 Darin Adler 2021-10-01 13:03:41 PDT
Comment on attachment 439743 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=439743&action=review

> Source/WebCore/bindings/js/JSAudioBufferSourceNodeCustom.cpp:40
> +    visitor.addOpaqueRoot(wrapped().buffer());

I think this needs a comment. Normally we mark things so we can preserve custom JavaScript property values on the wrapper, not so that garbage collection understands memory use. So this is needed for a subtle reason that someone might not understand.
Comment 5 Chris Dumez 2021-10-01 13:07:31 PDT
Created attachment 439900 [details]
Patch
Comment 6 EWS 2021-10-01 14:24:44 PDT
Committed r283402 (242405@main): <https://commits.webkit.org/242405@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 439900 [details].
Comment 7 Radar WebKit Bug Importer 2021-10-01 14:25:19 PDT
<rdar://problem/83782206>