Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alloca to Malloc for strucs #179

Merged
merged 7 commits into from
Sep 2, 2023
Merged

Alloca to Malloc for strucs #179

merged 7 commits into from
Sep 2, 2023

Conversation

Champii
Copy link
Owner

@Champii Champii commented Sep 1, 2023

This PR transforms all struct allocation from alloca instruction to malloc function call.
It adds two builtin functions malloc: Int64 => String and free: String => Int64

@Champii
Copy link
Owner Author

Champii commented Sep 1, 2023

Note: The malloc and free prototype from the stdlib will stay in place for the user to call them when needed. Might change later

@Champii Champii force-pushed the alloca_to_malloc_test branch from 0ed340c to 36adb22 Compare September 1, 2023 11:20
The arrays are still not well supported, to make the tests pass we fix
the arrays to have a fixed maximum size of 10.
This will obviously change later on when we will have a proper
implementation.
@Champii Champii force-pushed the alloca_to_malloc_test branch 6 times, most recently from 91ce9a0 to dac4706 Compare September 1, 2023 12:28
@Champii Champii force-pushed the alloca_to_malloc_test branch from 2727743 to 1297ab7 Compare September 2, 2023 10: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.

1 participant