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; ...@@ -1054,9 +1054,6 @@ PyAPI_FUNC(void) _PyTrash_thread_destroy_chain(void) PYSTON_NOEXCEPT;
#define PyTrash_UNWIND_LEVEL 50 #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) */ /* Note the workaround for when the thread state is NULL (issue #17703) */
#define Py_TRASHCAN_SAFE_BEGIN(op) \ #define Py_TRASHCAN_SAFE_BEGIN(op) \
do { \ do { \
...@@ -1077,9 +1074,6 @@ PyAPI_FUNC(void) _PyTrash_thread_destroy_chain(void) PYSTON_NOEXCEPT; ...@@ -1077,9 +1074,6 @@ PyAPI_FUNC(void) _PyTrash_thread_destroy_chain(void) PYSTON_NOEXCEPT;
else \ else \
_PyTrash_thread_deposit_object((PyObject*)op); \ _PyTrash_thread_deposit_object((PyObject*)op); \
} while (0); } while (0);
#endif
#define Py_TRASHCAN_SAFE_BEGIN(op) do {
#define Py_TRASHCAN_SAFE_END(op) } while (0);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -120,6 +120,9 @@ typedef struct _ts { ...@@ -120,6 +120,9 @@ typedef struct _ts {
PyObject *dict; /* Stores per-thread state */ 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 // Pyston note: additions in here need to be mirrored in ThreadStateInternal::accept
} PyThreadState; } PyThreadState;
......
...@@ -1108,4 +1108,11 @@ extern "C" void _Py_NegativeRefcount(const char* fname, int lineno, PyObject* op ...@@ -1108,4 +1108,11 @@ extern "C" void _Py_NegativeRefcount(const char* fname, int lineno, PyObject* op
} }
#endif /* Py_REF_DEBUG */ #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; ...@@ -38,7 +38,7 @@ std::unordered_set<PerThreadSetBase*> PerThreadSetBase::all_instances;
extern "C" { extern "C" {
__thread PyThreadState cur_thread_state __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; PthreadFastMutex threading_lock;
...@@ -142,6 +142,8 @@ public: ...@@ -142,6 +142,8 @@ public:
v->visit(&pub_state->curexc_traceback); v->visit(&pub_state->curexc_traceback);
if (pub_state->dict) if (pub_state->dict)
v->visit(&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) { for (auto& stack_info : previous_stacks) {
v->visit(&stack_info.next_generator); 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