8000 Making the memory manager more pluggable by vitiral · Pull Request #1604 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@vitiral
Copy link
Contributor
@vitiral vitiral commented Nov 7, 2015

This is the pull request for making the memory manager more pluggable -- i.e. separate the gc from the heap manager to allow advancements on both separately.

This is part of the solution for #1168 and is a rework of several PR attempts:

This PR attempts to consolodate the advice from those failed PR's and make a change that is as minimally invasive as possible to the existing code base and meets the coding guidlelines as much as possible.

The pull request uses the existing infrastructure to allow each build to select which garbage collector implementation it wants, either the original or the "basic" as the pluggable versions are being called. Eventually more gc implementations will be added, the next planned one is one that simply uses unix's malloc/free.

In addition, an astyle.fmt file has been added to the tools/ directory that should define a fair number of micropython's coding conventions so that new contributors can automatically get their code formatted correctly and painlessly. This file may be a work in progress.

Copy link
Contributor Author
vitiral commented Nov 8, 2015

TODO:
mp_state_ctx is tied into EVERYTHING.

t has documentation stating the following:

This structure combines the above 2 structures[including the gc_state structure], and adds the local and global dicts.
Note: if this structure changes then revisit all nlr asm code since they have the offset of nlr_top hard-coded.

I think I have a mechanism to cleanly break this appart, but I need to know if changing the gc_state object will really affect ASM code. Is it possible this can be broken appart so that gc_state is not part of mp_state_ctx?

@dpgeorge
Copy link
Member
dpgeorge commented Nov 9, 2015

I think I have a mechanism to cleanly break this appart, but I need to know if changing the gc_state object will really affect ASM code. Is it possible this can be broken appart so that gc_state is not part of mp_state_ctx?

It needs to stay as one whole. The idea is that we might in the future allow to pass around a single pointer which points to all the internal VM state, so that we can make it reentrant. This pointer would point to the mp_state_ctx, which then has in it all the other stuff, including memory manager state.

@vitiral
Copy link
Contributor Author
vitiral commented Nov 9, 2015

OK, but will changing the gc struct break ASM code?
On Nov 9, 2015 8:07 AM, "Damien George" notifications@github.com wrote:

I think I have a mechanism to cleanly break this appart, but I need to
know if changing the gc_state object will really affect ASM code. Is it
possible this can be broken appart so that gc_state is not part of
mp_state_ctx?

It needs to stay as one whole. The idea is that we might in the future
allow to pass around a single pointer which points to all the internal VM
state, so that we can make it reentrant. This pointer would point to the
mp_state_ctx, which then has in it all the other stuff, including memory
manager state.


Reply to this email directly or view it on GitHub
#1604 (comment)
.

@dpgeorge
Copy link
Member
dpgeorge commented Nov 9, 2015

OK, but will changing the gc struct break ASM code?

No. Changing mp_state_mem_t won't break the asm nlr code.

tannewt pushed a commit to tannewt/circuitpython that referenced this pull request Mar 8, 2019
…ame-check-interrupts

Don't wait for display frame if interrupt pending
@dpgeorge
Copy link
Member

Closing due to inactivity. See related effort in #3580.

@dpgeorge dpgeorge closed this Apr 20, 2021
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.

< 36D9 div class="participation">

3 participants

0