Skip to content

Range code uses Vec<Root<T>> #8737

Closed
Closed

Description

@jdm

This certainly used to be something that wasn't allowed back in the stack-scanning days because the vector elements weren't on the stack. Is this now valid with the new design for Root, or should we lint more strongly for this and rewrite the code?

http://mxr.mozilla.org/servo/search?string=vec%3Croot

cc @michaelwu @nox @Ms2ger

Activity

  1. added
    A-content/dom
    I-safety
    on Nov 29, 2015
  2. nox commented on Nov 29, 2015

    @nox
    Contributor

    This can probably return a RootedVec through RootedVec::with_destination_address.

  3. jdm commented on Nov 29, 2015

    @jdm
    MemberAuthor

    If this turns out to be unsafe, we need to update the bindings generation to disallow sequence<Interface> return types until we have a solution.

  4. nox commented on Nov 29, 2015

    @nox
    Contributor

    Err no it can't. We could pass a &mut RootedVec. Using Root here seems to be safe, but not very efficient, I guess.

  5. dzbarsky commented on Nov 29, 2015

    @dzbarsky
    Contributor

    That code should probably return an iterator instead of calling collect, but I didn't know how to make the lifetimes compile when I wrote it.

  6. michaelwu commented on Nov 30, 2015

    @michaelwu
    Contributor

    An iterator seems more appropriate here, for performance/memory reasons.

  7. jdm commented on Apr 22, 2016

    @jdm
    MemberAuthor

    The code isn't unsafe, so this is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-content/domI-safety

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions