Skip to content

make ItemSliceSync safe #1231

Open
Open
@martinvonz

Description

@martinvonz

Current behavior 😯

ItemSliceSync::get_mut() takes an non-mutable reference and an index. It doesn't check if there are multiple callers accessing the same index, so that's left to the caller to do (the function is therefore marked unsafe). I can't tell if the callers are actually guaranteed not to access the same index concurrently. My guess - without looking very carefully - is that the requirement can be violated by a bad packfile.

Expected behavior 🤔

Maybe ItemSliceSync should be replaced by a list of RefCell to make it safe?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions