Skip to content

Commit a41dd1c

Browse files
committed
Amend notes.md
1 parent 3d78eb5 commit a41dd1c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

ports/webassembly/notes.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,19 @@ Problems with mp_init() - in runtime - Near VM compilation fails
4242
Might be a linking issue, or memory handling issue, for example this code would cause the same error:
4343

4444

45+
```c
46+
#define MICROPY_HEAP_SIZE (32 * 1024)
47+
static char heap[MICROPY_HEAP_SIZE];
48+
49+
__attribute__((export_name("hello_easy_c")))
50+
void hello_easy_c() {
51+
52+
uint32_t result = 42;
53+
*((int32_t*)heap) = result;
54+
value_return((uint64_t)heap, sizeof(int32_t));
55+
}
56+
```
57+
4558
Error:
4659
0: Error: An error occurred during a `FunctionCall` Action, parameter is debug message.
4760
CompilationError(PrepareError(Memory))

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy