summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorstijn <stinos@zoho.com>2015-01-08 10:32:45 +0100
committerstijn <stinos@zoho.com>2015-01-08 15:29:44 +0100
commitafd6c8e1d2a2c24595194879481987cec3b57f8a (patch)
tree918ec7c40ee16d00c7f085a853b6f6e2e1010247 /py
parent181bfb6db2a089442e5b3d38d68b1236b8aa0eb0 (diff)
downloadmicropython-afd6c8e1d2a2c24595194879481987cec3b57f8a.tar.gz
micropython-afd6c8e1d2a2c24595194879481987cec3b57f8a.zip
Remove obsolete bss-related code/build features
GC for unix/windows builds doesn't make use of the bss section anymore, so we do not need the (sometimes complicated) build features and code related to it
Diffstat (limited to 'py')
-rw-r--r--py/gc.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/py/gc.c b/py/gc.c
index 73a6ca8612..f3f5937cf3 100644
--- a/py/gc.c
+++ b/py/gc.c
@@ -695,11 +695,9 @@ void gc_dump_alloc_table(void) {
case AT_FREE: c = '.'; break;
/* this prints out if the object is reachable from BSS or STACK (for unix only)
case AT_HEAD: {
- extern char __bss_start, _end;
- extern char *stack_top;
c = 'h';
- void **ptrs = (void**)&__bss_start;
- mp_uint_t len = ((mp_uint_t)&_end - (mp_uint_t)&__bss_start) / sizeof(mp_uint_t);
+ void **ptrs = (void**)(void*)&mp_state_ctx;
+ mp_uint_t len = offsetof(mp_state_ctx_t, vm.stack_top) / sizeof(mp_uint_t);
for (mp_uint_t i = 0; i < len; i++) {
mp_uint_t ptr = (mp_uint_t)ptrs[i];
if (VERIFY_PTR(ptr) && BLOCK_FROM_PTR(ptr) == bl) {
@@ -709,7 +707,7 @@ void gc_dump_alloc_table(void) {
}
if (c == 'h') {
ptrs = (void**)&c;
- len = ((mp_uint_t)stack_top - (mp_uint_t)&c) / sizeof(mp_uint_t);
+ len = ((mp_uint_t)MP_STATE_VM(stack_top) - (mp_uint_t)&c) / sizeof(mp_uint_t);
for (mp_uint_t i = 0; i < len; i++) {
mp_uint_t ptr = (mp_uint_t)ptrs[i];
if (VERIFY_PTR(ptr) && BLOCK_FROM_PTR(ptr) == bl) {