Commit 653433da authored by Kevin Modzelewski's avatar Kevin Modzelewski

add back trashcan macros

parent fa20017e
......@@ -1054,9 +1054,6 @@ PyAPI_FUNC(void) _PyTrash_thread_destroy_chain(void) PYSTON_NOEXCEPT;
#define PyTrash_UNWIND_LEVEL 50
// Pyston change: I don't think we need this since destructors
// are run differently
#if 0
/* Note the workaround for when the thread state is NULL (issue #17703) */
#define Py_TRASHCAN_SAFE_BEGIN(op) \
do { \
......@@ -1077,9 +1074,6 @@ PyAPI_FUNC(void) _PyTrash_thread_destroy_chain(void) PYSTON_NOEXCEPT;
else \
_PyTrash_thread_deposit_object((PyObject*)op); \
} while (0);
#endif
#define Py_TRASHCAN_SAFE_BEGIN(op) do {
#define Py_TRASHCAN_SAFE_END(op) } while (0);
#ifdef __cplusplus
}
......
......@@ -120,6 +120,9 @@ typedef struct _ts {
PyObject *dict; /* Stores per-thread state */
int trash_delete_nesting;
PyObject *trash_delete_later;
// Pyston note: additions in here need to be mirrored in ThreadStateInternal::accept
} PyThreadState;
......
......@@ -1108,4 +1108,11 @@ extern "C" void _Py_NegativeRefcount(const char* fname, int lineno, PyObject* op
}
#endif /* Py_REF_DEBUG */
extern "C" void _PyTrash_thread_deposit_object(PyObject* op) noexcept {
Py_FatalError("unimplemented");
}
extern "C" void _PyTrash_thread_destroy_chain() noexcept {
Py_FatalError("unimplemented");
}
}
......@@ -38,7 +38,7 @@ std::unordered_set<PerThreadSetBase*> PerThreadSetBase::all_instances;
extern "C" {
__thread PyThreadState cur_thread_state
= { 0, 1, NULL, NULL, NULL, NULL }; // not sure if we need to explicitly request zero-initialization
= { 0, 1, NULL, NULL, NULL, NULL, 0, NULL }; // not sure if we need to explicitly request zero-initialization
}
PthreadFastMutex threading_lock;
......@@ -142,6 +142,8 @@ public:
v->visit(&pub_state->curexc_traceback);
if (pub_state->dict)
v->visit(&pub_state->dict);
if (pub_state->trash_delete_later)
v->visit(&pub_state->trash_delete_later);
for (auto& stack_info : previous_stacks) {
v->visit(&stack_info.next_generator);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment