Choose garbage collection policy a bit more intelligently.
commite4b4aad5ae00b58f7eddf373499b524fabb87fea
authormhagger <mhagger@be7e6eca-30d4-0310-a8e5-ac0d63af7087>
Fri, 14 Jun 2013 07:04:43 +0000 (14 07:04 +0000)
committermhagger <mhagger@be7e6eca-30d4-0310-a8e5-ac0d63af7087>
Fri, 14 Jun 2013 07:04:43 +0000 (14 07:04 +0000)
treea69d56a8b861300f6abf7829075486bf7e984419
parentf9d4f4a434a7a56be34bd413bd751ec5fd9043ae
Choose garbage collection policy a bit more intelligently.

The CPython garbage-collector is only needed for circular reference
loops, because most unused objects are cleared via reference counting.
cvs2svn is careful not to create any reference loops, so under CPython
the garbage-collector costs a lot of overhead but brings zero benefit.
Therefore, it was disabled.

However, other Python implementations (e.g., Jython, PyPy in at least
one incarnation, and probably IronPython too) do not use reference
counting at all, and *rely* on the garbage collector to free unused
objects.

So, try to detect which Python implementation is being used, and
disable the garbage collector only if we are sure that we are running
under CPython.

Unfortunately, platform.python_implementation(), which provides the
required information, was only added in Python 2.6.  So on older
versions of Python, just leave the garbage collector on.  This will
cost some performance, but will always work.

This should fix an out-of-memory error that was reported by Jan Smets
<jan@smets.cx> when using PyPy.

git-svn-id: http://cvs2svn.tigris.org/svn/cvs2svn/trunk@5431 be7e6eca-30d4-0310-a8e5-ac0d63af7087
cvs2svn_lib/pass_manager.py