summaryrefslogtreecommitdiff
path: root/supervisor/memory.h
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2018-08-02 14:35:46 -0700
committerScott Shawcroft <scott@tannewt.org>2018-08-02 14:35:46 -0700
commit5704bc8c93e36ded3e7dc8e46aa836e7a2acee15 (patch)
tree0b604cde903906b96042279e7bd6871f3ed2f7dd /supervisor/memory.h
parenta88cdaca6a462da398b8e3a8a0c7de02d810ca37 (diff)
Share memory.c and a bit of polish.
Diffstat (limited to 'supervisor/memory.h')
-rwxr-xr-xsupervisor/memory.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/supervisor/memory.h b/supervisor/memory.h
index 1d64c2cde..4f8317a2d 100755
--- a/supervisor/memory.h
+++ b/supervisor/memory.h
@@ -24,6 +24,10 @@
* THE SOFTWARE.
*/
+// Basic allocations outside them for areas such as the VM heap and stack.
+// supervisor/shared/memory.c has a basic implementation for a continuous chunk of memory. Add it
+// to a SRC_ in a Makefile to use it.
+
#ifndef MICROPY_INCLUDED_SUPERVISOR_MEMORY_H
#define MICROPY_INCLUDED_SUPERVISOR_MEMORY_H
@@ -38,6 +42,10 @@ typedef struct {
void memory_init(void);
void free_memory(supervisor_allocation* allocation);
supervisor_allocation* allocate_remaining_memory(void);
+
+// Allocate a piece of a given length in bytes. If high_address is true then it should be allocated
+// at a lower address from the top of the stack. Otherwise, addresses will increase starting after
+// statically allocated memory.
supervisor_allocation* allocate_memory(uint32_t length, bool high_address);
#endif // MICROPY_INCLUDED_SUPERVISOR_MEMORY_H