def freeze_refcnts(self): rawrefcount._dont_free_any_more() return #ZZZ state = self.space.fromcache(RefcountState) self.frozen_refcounts = {} for w_obj, obj in state.py_objects_w2r.iteritems(): self.frozen_refcounts[w_obj] = obj.c_ob_refcnt #state.print_refcounts() self.frozen_ll2callocations = set(ll2ctypes.ALLOCATED.values())
def setup_class(cls): space = cls.space # warm up reference counts: # - the posix module allocates a HCRYPTPROV on Windows # - writing to stdout and stderr allocates a file lock space.getbuiltinmodule("cpyext") space.getbuiltinmodule(os.name) space.call_function(space.getattr(space.sys.get("stderr"), space.wrap("write")), space.wrap("")) space.call_function(space.getattr(space.sys.get("stdout"), space.wrap("write")), space.wrap("")) class CAPI: def __getattr__(self, name): return getattr(cls.space, name) cls.api = CAPI() CAPI.__dict__.update(api.INTERPLEVEL_API) print 'DONT_FREE_ANY_MORE' rawrefcount._dont_free_any_more()
def setup_class(cls): space = cls.space # warm up reference counts: # - the posix module allocates a HCRYPTPROV on Windows # - writing to stdout and stderr allocates a file lock space.getbuiltinmodule("cpyext") space.getbuiltinmodule(os.name) space.call_function(space.getattr(space.sys.get("stderr"), space.wrap("write")), space.wrap("")) space.call_function(space.getattr(space.sys.get("stdout"), space.wrap("write")), space.wrap("")) class CAPI: def __getattr__(self, name): return getattr(cls.space, name) cls.api = CAPI() CAPI.__dict__.update(INTERPLEVEL_API) print 'DONT_FREE_ANY_MORE' rawrefcount._dont_free_any_more()
def freeze_refcnts(self): rawrefcount._dont_free_any_more()