Skip to content

Use cfg no_global_oom_handling #594

@Clipi-12

Description

@Clipi-12

Issue

A big portion of the alloc crate uses cfg attributes to check whether global oom handling is enabled (see this example).

Right now the crate doesn't even compile when passing --cfg=no_global_oom_handling to rustc, so it would be nice if this crate also checked it.
It would also be nice if the existing API got extended to allow manually managing oom errors (for example, making a RawTable::try_insert which would call try_reserve instead of reserve, and so on with HashTable::insert_unique and the rest of the public API).

Impl

In a private fork of this repo I've easily managed to compile the crate without the std by cfg-ing crate::raw::Fallibility and every function / impl Trait that depended on it.
However, it is clear that the crate was not designed with the possibility of a global oom handler not existing, since there are no methods like try_insert or try_clone (which is itself a debate on it's own, since there is no TryClone trait in the std/core)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions