Skip to content
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

manifest.json: "creation" values are not explained #147

Closed
lll000111 opened this issue Mar 11, 2019 · 3 comments
Closed

manifest.json: "creation" values are not explained #147

lll000111 opened this issue Mar 11, 2019 · 3 comments

Comments

@lll000111
Copy link

lll000111 commented Mar 11, 2019

https://github.com/Moddable-OpenSource/moddable/blob/public/documentation/tools/manifest.md#creation

The only explanation:

The creation object defines the creation parameters of the XS machine that will run the app. See the XS in C documentation for details.

That page does not tell me e.g. what static does/means. It is briefly mentioned here as part of a struct. In the example below exactly this value is left out.

In particular, is there any number that sets a maximum? Or is memory allocated as long as there is any free physical memory left? Is this "static" property the maximum amount of memory used by a virtual machine, in bytes?

I checked the code as far as xs/platforms/esp/xsHost.c.


Related: #146
@lll000111
Copy link
Author

Whatever. I'll figure it out.

@lll000111
Copy link
Author

lll000111 commented Mar 13, 2019

For the record, should anyone get here, because unanswered questions that you come across while searching for a problem you have have an xkcd and also a Dilbert, I think:

Found this:

https://github.com/Moddable-OpenSource/moddable/blob/public/xs/platforms/esp/xsHost.c#L660

which defines ESP_cloneMachine which uses stackSize for a call to malloc.

That function is used by ./build/devices/esp32/xsProj/main/main.c to create the virtual machine:

https://github.com/Moddable-OpenSource/moddable/blob/public/build/devices/esp32/xsProj/main/main.c#L141


To get support for all the RAM on the board go to $MODDABLE/build/devices/esp32/xsProj/ and set CONFIG_SPIRAM_SUPPORT=y in the ESP-IDF sdkconfig file, as well as enabling SPIRAM_USE_MALLOC, probably.

Reference: https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/kconfig.html#config-spiram-support


Still, after following — or trying to — this allocation I'm still not sure what that allocated memory is for. It appears to be the heap? The explanations of "context" in "XS in C" is confusing when I compare it with the linked code, no word about heap or the allocated memory, or what "context" actually means. Also, ESP_cloneMachine from above calls xsSetContext(result, NULL);before returning, setting the context to NULL???

The documentation could really explain a bit more.

@chances
Copy link

chances commented Dec 21, 2020

The manifest documentation has removed the reference to the XS in C document and the machine allocation documentation still does not explain what the staticSize (i.e. static in manifests) is/does.

@lll000111 I've opened #521

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

No branches or pull requests

2 participants