[ion][python] Implement an architecture-dependant collect_registers.

setjmp is not guaranteed to collect all registers without modification
on all platforms.

This fixes the following bug: when the pointer of a newly allocated
object on the Python heap is stored in rpb registers on x86_64 arch, it
was not collected by the garbarge collector.
This commit is contained in:
Émilie Feral
2020-05-14 16:22:51 +02:00
committed by LeaNumworks
parent 5a32006dcd
commit 3f6647f3ae
13 changed files with 98 additions and 31 deletions

View File

@@ -1,6 +1,7 @@
#ifndef LIBA_SETJMP_H
#define LIBA_SETJMP_H
#include <stdint.h>
#include "private/macros.h"
/* We are preseving registers:
@@ -14,7 +15,7 @@
LIBA_BEGIN_DECLS
typedef int jmp_buf[31];
typedef uintptr_t jmp_buf[31];
void longjmp(jmp_buf env, int val);
int setjmp(jmp_buf env);