-
Notifications
You must be signed in to change notification settings - Fork 265
Migration to the SDK memory allocator #792
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b292d66
Renamed all functions of the existing memory allocator
apaillier-ledger 4338b41
Added new functions to use new SDK memory allocator
apaillier-ledger 9014576
Migrated all features to the new allocator (except EIP-712 for now)
apaillier-ledger 0edf9b7
Simplified global state in tlv_from_apdu
apaillier-ledger 8008fba
Removed legacy rev allocation
apaillier-ledger 3a1872e
Increased the size of the mem buffer & the new allocator can be used …
apaillier-ledger b97df9b
Fix fuzzer
apaillier-ledger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,23 @@ | ||
| #pragma once | ||
|
|
||
| #include <stdbool.h> | ||
| #include <stdlib.h> | ||
|
|
||
| void mem_init(void); | ||
| void mem_reset(void); | ||
| void *mem_alloc(size_t size); | ||
| void mem_dealloc(size_t size); | ||
| void *mem_rev_alloc(size_t size); | ||
| void mem_rev_dealloc(size_t size); | ||
| #ifdef HAVE_MEMORY_PROFILING | ||
| #define MP_FILE __FILE__ | ||
| #define MP_LINE __LINE__ | ||
| #else | ||
| #define MP_FILE NULL | ||
| #define MP_LINE 0 | ||
| #endif | ||
| #define app_mem_alloc(size) app_mem_alloc_impl(size, MP_FILE, MP_LINE) | ||
| #define app_mem_free(ptr) app_mem_free_impl(ptr, MP_FILE, MP_LINE) | ||
|
|
||
| bool app_mem_init(void); | ||
| void *app_mem_alloc_impl(size_t size, const char *file, int line); | ||
| void app_mem_free_impl(void *ptr, const char *file, int line); | ||
|
|
||
| void mem_legacy_init(void); | ||
| void mem_legacy_reset(void); | ||
| void *mem_legacy_alloc(size_t size); | ||
| void mem_legacy_dealloc(size_t size); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.