mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[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:
committed by
LeaNumworks
parent
5a32006dcd
commit
3f6647f3ae
@@ -17,6 +17,7 @@
|
||||
#include <ion/unicode/utf8_helper.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <setjmp.h>
|
||||
|
||||
/* ION is not your regular library. It is a library you link against, but it
|
||||
* will take care of configuring the whole environment for you. In POSIX terms,
|
||||
@@ -48,6 +49,9 @@ void decompress(const uint8_t * src, uint8_t * dst, int srcSize, int dstSize);
|
||||
// Tells whether the stack pointer is within acceptable bounds
|
||||
bool stackSafe();
|
||||
|
||||
// Collect registers in a buffer and returns the stack pointer
|
||||
uintptr_t collectRegisters(jmp_buf regs);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user