[Patches] [Patch #101753] exception bugfix for gcmodule.c
noreply@sourceforge.net
noreply@sourceforge.net
Wed, 4 Oct 2000 09:28:28 -0700
Patch #101753 has been updated.
Project:
Category: core (C code)
Status: Closed
Summary: exception bugfix for gcmodule.c
Follow-Ups:
Date: 2000-Oct-03 09:54
By: nascheme
Comment:
Don't start collection if an exception has been raised otherwise the collector will think that it caused the error.
-------------------------------------------------------
Date: 2000-Oct-04 00:06
By: loewis
Comment:
An interesting bug, and an interesting patch...
How many times is _PyGC_Insert typically invoked before the exception is cleared (e.g. in your test cases)? If that is "often", would it make sense to temporarily increase the threshold0 to delay collection?
e.g.
static int extra_threshold = 0;
if(allocated > threshold0+extra_threshold ...){
if(PyErr_Occurred())
extra_threshold += threshold0 / 10; /* number picked arbitrarily */
else{
extra_threshold = 0;
collecting++;
...
-------------------------------------------------------
Date: 2000-Oct-04 04:52
By: nascheme
Comment:
I expect this bug would be triggered extremely rarely with
the default threshold0. I found it while testing with
threshold0 = 1. If the user changed the threshold then I
don't think its up to the GC to increase it. Also, I
don't think the extra complexity is worth it.
-------------------------------------------------------
Date: 2000-Oct-04 09:28
By: nascheme
Comment:
Applied.
-------------------------------------------------------
-------------------------------------------------------
For more info, visit:
http://sourceforge.net/patch/?func=detailpatch&patch_id=101753&group_id=5470