Skip to content

CLN: local_mut and multipole_mut accessors need to be made safe #175

@skailasa

Description

@skailasa

At the moment local_mut and multipole_mut are implemented as a part of the DataAccess and DataAccess multi traits, they operate using interior mutability of KiFmm structs. However, this is considered an anti-pattern as of the most recent RF - as if multiple mutable references are held and written to behaviour is undefined, this isn't currently an issue as access via these methods is rare across the library and also single threaded in core code.

A choice has to be made to either make safe versions of these functions, by wrapping in a refcell or related threadsafe object the returned raw pointer or remove these methods altogether, or at the very least not to expose them to the public API so that users do not accidentally cause undefined behaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions