summaryrefslogtreecommitdiffstats
path: root/Objects/obmalloc.c
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2002-03-30 06:20:23 (GMT)
committerTim Peters <tim.peters@gmail.com>2002-03-30 06:20:23 (GMT)
commit12300686ca805289a340b740856ad00139a9b3c8 (patch)
tree388cba79e149130161530e76a9ab12a28d4252b1 /Objects/obmalloc.c
parentd97a1c008c4a7ae04c55c8de2cdb71a9ea43656a (diff)
downloadcpython-12300686ca805289a340b740856ad00139a9b3c8.zip
cpython-12300686ca805289a340b740856ad00139a9b3c8.tar.gz
cpython-12300686ca805289a340b740856ad00139a9b3c8.tar.bz2
Retract the claim that this is always safe if PyMem_{Del, DEL, Free, FREE}
are called without the GIL. It's incredibly unlikely to fail, but I can't make this bulletproof without either adding a lock for exclusion, or giving up on growing the arena base-address vector (it would be safe if this were a static array).
Diffstat (limited to 'Objects/obmalloc.c')
-rw-r--r--Objects/obmalloc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c
index 5ac5c35..500afba 100644
--- a/Objects/obmalloc.c
+++ b/Objects/obmalloc.c
@@ -403,6 +403,10 @@ new_arena(void)
* only make a supposed-to-succeed case fail by mistake).
* Read the above 50 times before changing anything in this
* block.
+ * XXX Fudge. This is still vulnerable: there's nothing
+ * XXX to stop the bad-guy thread from picking up the
+ * XXX current value of arenas, but not indexing off of it
+ * XXX until after the PyMem_FREE(oldarenas) below completes.
*/
uptr *oldarenas;
int newmax = maxarenas + (maxarenas >> 1);