Skip to content

Conversation

frivieremicroej
Copy link
Contributor

No description provided.

@frivieremicroej frivieremicroej marked this pull request as draft February 12, 2025 17:14
@frivieremicroej
Copy link
Contributor Author

frivieremicroej commented Feb 12, 2025

Copy link
Contributor

@nhouze-microej nhouze-microej left a 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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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);
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

dalgassimou and others added 24 commits October 3, 2025 17:59
@targa-microej
Copy link
Contributor

rebased on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

10 participants