mirror of
https://github.com/johndoe6345789/typthon.git
synced 2026-04-27 15:15:35 +00:00
Fix more missed Py_ patterns - opcode, thread, exception
Fixed additional patterns: - _PyOpcode_* → _TyOpcode_* (all opcode metadata) - _PyUOpName → _TyUOpName - _PyFunction_* → _TyFunction_* - _PyListIterObject → _TyListIterObject - _Py_T_OBJECT → _Ty_T_OBJECT - Py_BEGIN_ALLOW_THREADS, Py_END_ALLOW_THREADS → Ty_* - PyDoc_STRVAR, PyDoc_STR → TyDoc_* - PyInterpreterState, PyThread_*, PyTime_t → Ty* - PyStructSequence_* → TyStructSequence_* - PyLockStatus → TyLockStatus - PyVarObject_HEAD_INIT → TyVarObject_HEAD_INIT - PyBaseExceptionObject → TyBaseExceptionObject - Fixed _PyExc_ → _TyExc_ in exception macros Build is progressing further. Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
@@ -96,9 +96,9 @@ tracemalloc_error(const char *format, ...)
|
||||
static int
|
||||
get_reentrant(void)
|
||||
{
|
||||
assert(PyThread_tss_is_created(&tracemalloc_reentrant_key));
|
||||
assert(TyThread_tss_is_created(&tracemalloc_reentrant_key));
|
||||
|
||||
void *ptr = PyThread_tss_get(&tracemalloc_reentrant_key);
|
||||
void *ptr = TyThread_tss_get(&tracemalloc_reentrant_key);
|
||||
if (ptr != NULL) {
|
||||
assert(ptr == REENTRANT);
|
||||
return 1;
|
||||
@@ -112,15 +112,15 @@ static void
|
||||
set_reentrant(int reentrant)
|
||||
{
|
||||
assert(reentrant == 0 || reentrant == 1);
|
||||
assert(PyThread_tss_is_created(&tracemalloc_reentrant_key));
|
||||
assert(TyThread_tss_is_created(&tracemalloc_reentrant_key));
|
||||
|
||||
if (reentrant) {
|
||||
assert(!get_reentrant());
|
||||
PyThread_tss_set(&tracemalloc_reentrant_key, REENTRANT);
|
||||
TyThread_tss_set(&tracemalloc_reentrant_key, REENTRANT);
|
||||
}
|
||||
else {
|
||||
assert(get_reentrant());
|
||||
PyThread_tss_set(&tracemalloc_reentrant_key, NULL);
|
||||
TyThread_tss_set(&tracemalloc_reentrant_key, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -733,7 +733,7 @@ _PyTraceMalloc_Init(void)
|
||||
|
||||
TyMem_GetAllocator(PYMEM_DOMAIN_RAW, &allocators.raw);
|
||||
|
||||
if (PyThread_tss_create(&tracemalloc_reentrant_key) != 0) {
|
||||
if (TyThread_tss_create(&tracemalloc_reentrant_key) != 0) {
|
||||
return _TyStatus_NO_MEMORY();
|
||||
}
|
||||
|
||||
@@ -781,7 +781,7 @@ tracemalloc_deinit(void)
|
||||
_Ty_hashtable_destroy(tracemalloc_tracebacks);
|
||||
_Ty_hashtable_destroy(tracemalloc_filenames);
|
||||
|
||||
PyThread_tss_delete(&tracemalloc_reentrant_key);
|
||||
TyThread_tss_delete(&tracemalloc_reentrant_key);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user