[Python-checkins] CVS: python/dist/src/Objects obmalloc.c,2.13,2.14

Tim Peters tim_one@users.sourceforge.net
Fri, 29 Mar 2002 22:20:25 -0800


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv3755/python/Objects

Modified Files:
	obmalloc.c 
Log Message:
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).


Index: obmalloc.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/obmalloc.c,v
retrieving revision 2.13
retrieving revision 2.14
diff -C2 -d -r2.13 -r2.14
*** obmalloc.c	30 Mar 2002 06:09:22 -0000	2.13
--- obmalloc.c	30 Mar 2002 06:20:23 -0000	2.14
***************
*** 404,407 ****
--- 404,411 ----
  		 * 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;