E&S CVS Commit: PEAK - Fix "inverse refcount leak" introduced when support was added for recursive

pje at eby-sarna.com pje at eby-sarna.com
Tue Sep 9 16:44:01 EDT 2003


Module Name:	PEAK
Committed By:	pje
Date:		Tue Sep  9 20:43:05 UTC 2003

Modified Files:
	PEAK/src/peak/util: fmtparse.py

Log Message:
Fix "inverse refcount leak" introduced when support was added for recursive
grammars.  Using 'id()' to key a dictionary is a bad idea if the objects
you're taking the 'id()' of can be deallocated while the entry is still in
the dictionary; this led to occasional weird problems with some grammars.
Apparently, when I wrote this I thought there'd be references held for as
long as the memo dictionary existed, but this isn't the case.  So now, the
memo holds a reference to the key object in the value, ensuring that the
reference can't go away until the entire dictionary is discarded.


To view diffs of this commit, you can use the following URL(s):
http://cvs.eby-sarna.com/PEAK/src/peak/util/fmtparse.py.diff?r1=1.7&r2=1.8

To generate a diff of this commit:
cvs rdiff -r1.7 -r1.8 PEAK/src/peak/util/fmtparse.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




More information about the source-changes mailing list