Skip to content

Avoid allocations in fmt machinery#478

Closed
shamatar wants to merge 4 commits intorecmo:mainfrom
shamatar:remove_alloc_in_format
Closed

Avoid allocations in fmt machinery#478
shamatar wants to merge 4 commits intorecmo:mainfrom
shamatar:remove_alloc_in_format

Conversation

@shamatar
Copy link

But still keep it under (different) feature flag

Motivation

Use of formatting in no_std environments (or environments where Global allocator is not desired)

Solution

Use stack-allocated buffer instead, with clear upper bound on number of possible limbs used for formatting

PR Checklist

  • Added Tests
  • Added Documentation
  • Updated the changelog

@shamatar shamatar requested a review from prestwich as a code owner May 29, 2025 11:57
@lightsing
Copy link
Contributor

why this need to be gated behind a feature fmt?

@shamatar
Copy link
Author

shamatar commented Jul 5, 2025

Previously it was locked under alloc, so it’s somewhat arbitrary

@prestwich
Copy link
Collaborator

Previously it was locked under alloc, so it’s somewhat arbitrary

The purpose of the alloc gate was to preserve maximum flexibility for no-std users with an alloc-free approach we can remove the feature-gating entirely

@shamatar
Copy link
Author

shamatar commented Jul 8, 2025

Sure, I removed the feature gate

@prestwich
Copy link
Collaborator

related work that achieves the same goal has been included in #488

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants