##// END OF EJS Templates
util: make nogc effective for CPython...
Jun Wu -
r33796:05264fc9 default
parent child Browse files
Show More
@@ -964,10 +964,9 b' def nogc(func):'
964 964 into. As a workaround, disable GC while building complex (huge)
965 965 containers.
966 966
967 This garbage collector issue have been fixed in 2.7.
967 This garbage collector issue have been fixed in 2.7. But it still affect
968 CPython's performance.
968 969 """
969 if sys.version_info >= (2, 7):
970 return func
971 970 def wrapper(*args, **kwargs):
972 971 gcenabled = gc.isenabled()
973 972 gc.disable()
@@ -978,6 +977,10 b' def nogc(func):'
978 977 gc.enable()
979 978 return wrapper
980 979
980 if pycompat.ispypy:
981 # PyPy runs slower with gc disabled
982 nogc = lambda x: x
983
981 984 def pathto(root, n1, n2):
982 985 '''return the relative path from one place to another.
983 986 root should use os.sep to separate directories
General Comments 0
You need to be logged in to leave comments. Login now