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

Skip to content

Making the memory manager more pluggable #1604

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

Closed
wants to merge 12 commits into from
Closed

Making the memory manager more pluggable #1604

wants to merge 12 commits into from

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.

@vitiral
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.

@pfalcon pfalcon changed the title Mem pluggable Making the memory manager more pluggable Dec 3, 2015
@pfalcon pfalcon force-pushed the master branch 6 times, most recently from 9167980 to 1cc81ed Compare April 10, 2016 22:16
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.

3 participants
0