Skip to content

Reference counting and "new reference" #379

@annevk

Description

@annevk

I understand the desire to give implementations advice on how to best manage memory for these objects, but I don't think that should translate into normative language. Especially as that normative language is what is already the case for the web platform.

If A holds a reference to B, that's a strong reference that cannot be collected. And if C now also holds a reference, B has two things pointing to it. And cannot be collected until either those references are cleared or A and C disappear.

I would therefore suggest:

  • Turning most of the reference counting section into a note, to the extent you consider it worth keeping.

  • Remove "A media resource MUST remain alive at least as long as it continues to be referenced by a [[resource reference]]." as that is already required.

  • Change language of the form

    1. Let resource be the media resource referenced by data’s [[resource reference]].
    2. Let reference be a new reference to resource.
    3. Assign reference to [[resource reference]].

    to

    1. Set ???'s [[resource reference]] to data’s [[resource reference]].

(Currently it's not always clear what object the internal slot is from, that's the ??? above. I'd recommend spelling that out each time.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    editorialchanges to wording, grammar, etc that don't modify the intended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions