--- a PPN by Garber Painting Akron. With Image Size Reduction included!URL: http://github.com/python/cpython/pull/114122.patch
IST > 0
+#ifdef WITH_FREELISTS
static struct _Py_context_state *
get_context_state(void)
{
@@ -340,13 +340,9 @@ static inline PyContext *
_context_alloc(void)
{
PyContext *ctx;
-#if PyContext_MAXFREELIST > 0
+#ifdef WITH_FREELISTS
struct _Py_context_state *state = get_context_state();
-#ifdef Py_DEBUG
- // _context_alloc() must not be called after _PyContext_Fini()
- assert(state->numfree != -1);
-#endif
- if (state->numfree) {
+ if (state->numfree > 0) {
state->numfree--;
ctx = state->freelist;
state->freelist = (PyContext *)ctx->ctx_weakreflist;
From df1c87107aa9f5b05d0769e1f7cd6be9ed7bdc85 Mon Sep 17 00:00:00 2001
From: Donghee Na
Date: Wed, 17 Jan 2024 00:26:47 +0900
Subject: [PATCH 3/4] fix
---
Python/context.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Python/context.c b/Python/context.c
index 6540e400651dc8..1e90811c374ec6 100644
--- a/Python/context.c
+++ b/Python/context.c
@@ -1269,7 +1269,7 @@ get_token_missing(void)
void
_PyContext_ClearFreeList(_PyFreeListState *freelist_state, int is_finalization)
{
-#if WITH_FREELISTS
+#ifdef WITH_FREELISTS
struct _Py_context_state *state = &freelist_state->context_state;
for (; state->numfree > 0; state->numfree--) {
PyContext *ctx = state->freelist;
From 0f7d9f9b54c2e85b4b9200cc0e0877a973b7521f Mon Sep 17 00:00:00 2001
From: Donghee Na
Date: Wed, 17 Jan 2024 00:51:40 +0900
Subject: [PATCH 4/4] Address code review
---
Include/internal/pycore_freelist.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Include/internal/pycore_freelist.h b/Include/internal/pycore_freelist.h
index 6edb4230e2d537..566d47dbea11af 100644
--- a/Include/internal/pycore_freelist.h
+++ b/Include/internal/pycore_freelist.h
@@ -70,7 +70,7 @@ struct _Py_slice_state {
};
struct _Py_context_state {
-#if PyContext_MAXFREELIST > 0
+#ifdef WITH_FREELISTS
// List of free PyContext objects
PyContext *freelist;
int numfree;
pFad - Phonifier reborn
Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy