summaryrefslogtreecommitdiffstatshomepage
path: root/unix
diff options
context:
space:
mode:
Diffstat (limited to 'unix')
-rw-r--r--unix/gccollect.c2
-rw-r--r--unix/main.c4
-rw-r--r--unix/modffi.c5
3 files changed, 8 insertions, 3 deletions
diff --git a/unix/gccollect.c b/unix/gccollect.c
index be05ff3ebc..d04e5d87fb 100644
--- a/unix/gccollect.c
+++ b/unix/gccollect.c
@@ -32,7 +32,7 @@
#if MICROPY_ENABLE_GC
-extern void *stack_top;
+extern char *stack_top;
#if MICROPY_GCREGS_SETJMP
#include <setjmp.h>
diff --git a/unix/main.c b/unix/main.c
index 1bee639eb2..176cbc6ec3 100644
--- a/unix/main.c
+++ b/unix/main.c
@@ -214,7 +214,7 @@ int usage(char **argv) {
mp_obj_t mem_info(void) {
printf("mem: total=%d, current=%d, peak=%d\n",
m_get_total_bytes_allocated(), m_get_current_bytes_allocated(), m_get_peak_bytes_allocated());
- printf("stack: %u\n", stack_usage());
+ printf("stack: %u\n", mp_stack_usage());
#if MICROPY_ENABLE_GC
gc_dump_info();
#endif
@@ -265,7 +265,7 @@ void pre_process_options(int argc, char **argv) {
#endif
int main(int argc, char **argv) {
- stack_set_limit(32768);
+ mp_stack_set_limit(32768);
pre_process_options(argc, argv);
diff --git a/unix/modffi.c b/unix/modffi.c
index 48666aef0b..eca3f9131b 100644
--- a/unix/modffi.c
+++ b/unix/modffi.c
@@ -51,6 +51,10 @@
* s - as argument, the same as "p", as return value, causes string
* to be allocated and returned, instead of pointer value.
*
+ * TODO:
+ * O - mp_obj_t, passed as is (mostly useful as callback param)
+ * C - callback function
+ *
* Note: all constraint specified by typecode can be not enforced at this time,
* but may be later.
*/
@@ -108,6 +112,7 @@ STATIC ffi_type *char2ffi_type(char c)
case 'L': return &ffi_type_ulong;
case 'f': return &ffi_type_float;
case 'd': return &ffi_type_double;
+ case 'C': // (*)()
case 'P': // const void*
case 'p': // void*
case 's': return &ffi_type_pointer;