summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/pendsv.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-01-07 23:38:50 +0000
committerDamien George <damien.p.george@gmail.com>2015-01-07 23:38:50 +0000
commit3b51b3e90f1d513031ad2c6b6a2a0d5d391f753d (patch)
tree6903d1a13bdc49860c325e531e81582beb6063bf /stmhal/pendsv.c
parent7a0636e80aea2ce1af03c890e024dabcdffcdf78 (diff)
downloadmicropython-3b51b3e90f1d513031ad2c6b6a2a0d5d391f753d.tar.gz
micropython-3b51b3e90f1d513031ad2c6b6a2a0d5d391f753d.zip
stmhal: Collect all root pointers together in 1 place.
A GC in stmhal port now only scans true root pointers, not entire BSS. This reduces base GC time from 1700ms to 900ms.
Diffstat (limited to 'stmhal/pendsv.c')
-rw-r--r--stmhal/pendsv.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/stmhal/pendsv.c b/stmhal/pendsv.c
index d7104d8518..68455b2752 100644
--- a/stmhal/pendsv.c
+++ b/stmhal/pendsv.c
@@ -31,7 +31,10 @@
#include "py/runtime.h"
#include "pendsv.h"
-static void *pendsv_object = NULL;
+// Note: this can contain point to the heap but is not traced by GC.
+// This is okay because we only ever set it to mp_const_vcp_interrupt
+// which is in the root-pointer set.
+STATIC void *pendsv_object;
void pendsv_init(void) {
// set PendSV interrupt at lowest priority