diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2019-01-10 11:00:40 -0800 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2019-01-10 11:00:40 -0800 |
| commit | 3dd59c3d5fa59f5bea3acc8e55c4d4a5091e66eb (patch) | |
| tree | 2f88dec06349002ce2406046ab260a7429a21b3d /supervisor/memory.h | |
| parent | b5e40f52c2b1c2890c866d7305e0e99b4811b7f5 (diff) | |
Polish thanks to Dan's feedback
Diffstat (limited to 'supervisor/memory.h')
| -rwxr-xr-x | supervisor/memory.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/supervisor/memory.h b/supervisor/memory.h index 4f8317a2d..c89f14bd9 100755 --- a/supervisor/memory.h +++ b/supervisor/memory.h @@ -39,6 +39,8 @@ typedef struct { uint32_t length; // in bytes } supervisor_allocation; + + void memory_init(void); void free_memory(supervisor_allocation* allocation); supervisor_allocation* allocate_remaining_memory(void); @@ -48,4 +50,11 @@ supervisor_allocation* allocate_remaining_memory(void); // statically allocated memory. supervisor_allocation* allocate_memory(uint32_t length, bool high_address); +static inline uint16_t align32_size(uint16_t size) { + if (size % 4 != 0) { + return (size & 0xfffc) + 0x4; + } + return size; +} + #endif // MICROPY_INCLUDED_SUPERVISOR_MEMORY_H |
