-
Notifications
You must be signed in to change notification settings - Fork 18
managedc #1209
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
base: master
Are you sure you want to change the base?
managedc #1209
Conversation
Official preview link: https://docs.microej.com/en/managedc/ApplicationDeveloperGuide/managedc/index.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@frivieremicroej i added some comments based on my tests on linux and on target
void print_time() { | ||
struct timespec ts; | ||
clock_gettime(CLOCK_REALTIME, &ts); | ||
printf("%lld.%.9ld", (long long)ts.tv_sec, ts.tv_nsec); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
printf("%lld.%.9ld", (long long)ts.tv_sec, ts.tv_nsec); | |
printf("%lld.%.9ld", (long long)ts.tv_sec, ts.tv_nsec); | |
printf("%lld.%.9ld\n", (long long)ts.tv_sec, ts.tv_nsec); |
Without \n
the program will not print anything
public static void main(String[] args) throws IOException { | ||
|
||
// Initialize WASI with the memory of my_app module and no preopened directories | ||
Wasi.init(Memory, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't build in my case.
1. ERROR in C:\git\managedc\Tool-Project-Template-Application\src\main\java\com\mycompany\myapplication\Main.java (at line 59) Wasi.init(Memory, null);
The following builds:
Wasi.init(Memory);
or
Wasi.init(Memory, (String[]) null);
|
||
.. code:: bash | ||
|
||
git clone git@github.com:MicroEJ/Tool-Project-Template-Application.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we try to run the factorial
sample, then it won't work because the default Java heap (64KB) is not enough, the wasi runtime is probably bigger than before...
------------------------------------- | ||
|
||
The Core Engine allows to expose Managed C memory to Java. A Managed C module contains | ||
at most one memory. This Managed C module memory is automatically generated by the C compiler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at most one memory. This Managed C module memory is automatically generated by the C compiler | |
at most one memory. This Managed C module memory is automatically generated by the C compiler | |
at most one shared memory. This Managed C module memory is automatically generated by the C compiler |
Use malloc heap instead of heap + main stack everywhere
- remove -Wl,--no-entry : useless only needed with -nostdlib - remove compile specific options: -mcpu=mvp -O3 - add -Wl,--allow-undefined (likelky there is a C->Java callback) also document the specific case of the main function
we will revisit this section with a dedicated PR see #1346 (comment)
also improve wording
ff88fbe
to
18d3244
Compare
rebased on master. |
…for memory load/store and atomic instructions (#1360)
No description provided.