Skip to content

Comments

Only import alloc if alloc feature enabled#4

Merged
leighmcculloch merged 1 commit intomainfrom
alloc
Dec 1, 2023
Merged

Only import alloc if alloc feature enabled#4
leighmcculloch merged 1 commit intomainfrom
alloc

Conversation

@leighmcculloch
Copy link
Member

What

Only import alloc if alloc feature enabled.

Why

Importing alloc all the time causes the global allocator to be need to be set. But the intent of the alloc feature is to make the lib compatible with builds that don't have an allocator, of which the soroban-sdk is one.

We don't actually use escape-bytes in the soroban-sdk when building for wasm, but through a series of unfortunate events escape-bytes is still getting included because we use it for Debug impls in stellar-xdr that get compiled for all targets.

@leighmcculloch leighmcculloch marked this pull request as ready for review December 1, 2023 18:17
@leighmcculloch leighmcculloch enabled auto-merge (squash) December 1, 2023 18:18
@leighmcculloch leighmcculloch merged commit ea67a57 into main Dec 1, 2023
@leighmcculloch leighmcculloch deleted the alloc branch December 1, 2023 18:23
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.

2 participants