-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Closed
Labels
rfcRequest for CommentRequest for Comment
Description
This is a point that was brought up in the tinymem forum thread, where @pfalcon said:
Making uPy GC pluggable, so it can work with system heap (or any external memory manager) is a worthy aim to follow.
This issue is meant to address this, while simultaneously addressing a separate issue associated with the tinymem library -- that it uses pointer indirection to do it's defragmentation, and therefore all calls to pointers need to be wrapped in a tm_void()
function call (in some way)
The way to solve this would be:
- make the underlying structure of the memory manager use a macro like
base_alloc
andbase_free
that could be adjusted depending on the memory manager used - have all pointers pass through macros. So, for example, instead of saying
uint8_t *dynamically_allocated_pointer
you would saymemptr_uint8_p(index)
-- which would convert it to a pointer for you.
This is necessary to plugin into custom memory allocators, like the one I am developing for uPython, the tinymem memory manager
Metadata
Metadata
Assignees
Labels
rfcRequest for CommentRequest for Comment