Skip to content

[Feature] Move alloc feature behind a feature gate #999

@Pzixel

Description

@Pzixel

Component

primitives

Describe the feature you would like

I've checked the codebase, and two types that are used from the alloc crate are String and vec.

There is a possibility to move remove the alloc dependency from the crate. The only type that will be disabled by that is Bytes - but all Uxxx and Ixxx math, Address type and others will remain.

There is a bunch of formatting that use String here and there, but it all can be replaced with on-stack buffers (stack-based arrayvec::ArrayString can be used instead), because for all those cases we either know the exact buffer size of at least the maximum possible string size.

I think is reasonable to assume that primitive_types can work without the alloc, hence this issue. I can work on an implementation if this is something you consider to be accepted.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions