Skip to content

Conversation

bgould
Copy link
Member

@bgould bgould commented Mar 27, 2020

These are implementations of malloc and free that delegate to the GC implementation.

Note: I'm not totally sure what the correct build tag to use for this is, if any. baremetal seems to work well but please feel free to suggest an alternative if there is something more appropriate. Also if you think that there is so better design for how these should be implemented that is fine too.

@aykevl
Copy link
Member

aykevl commented Mar 29, 2020

I have done some size tests to make sure this doesn't blow up size unexpectedly, and it only seems to increase code size on very small blinking LED samples. Any real programs will have no or very moderate (16 bytes) increases in binary size, so I think it's fine.

Because this code is only relevant on baremetal targets, I think it makes sense to move it to src/runtime/baremetal.go, which is already protected by the same build constraint.

@aykevl aykevl merged commit 57320c0 into tinygo-org:dev Mar 30, 2020
@aykevl
Copy link
Member

aykevl commented Mar 30, 2020

Thank you! Squashed/merged your changed in the dev branch.

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