All Samples(2202) | Call(1940) | Derive(0) | Import(262)
getrefcount(object) -> integer Return the reference count of object. The count returned is generally one higher than you might expect, because it includes the (temporary) reference as an argument to getrefcount().
src/s/c/scipy-HEAD/scipy/weave/examples/vtk_example.py scipy(Download)
a = vtk.vtkStructuredPoints()
a.SetOrigin(1.0, 1.0, 1.0)
print "sys.getrefcount(a) = ", sys.getrefcount(a)
code=r"""
printf("a->ClassName() == %s\n", a->GetClassName());
printf("a->GetReferenceCount() == %d\n", a->GetReferenceCount());
double *origin = a->GetOrigin();
printf("Origin = %f, %f, %f\n", origin[0], origin[1], origin[2]);
"""
weave.inline(code, ['a'], include_dirs=inc_dirs, library_dirs=lib_dirs)
print "sys.getrefcount(a) = ", sys.getrefcount(a)
src/s/c/scipy-0.8.0/scipy/weave/examples/vtk_example.py scipy(Download)
a = vtk.vtkStructuredPoints()
a.SetOrigin(1.0, 1.0, 1.0)
print "sys.getrefcount(a) = ", sys.getrefcount(a)
code=r"""
printf("a->ClassName() == %s\n", a->GetClassName());
printf("a->GetReferenceCount() == %d\n", a->GetReferenceCount());
double *origin = a->GetOrigin();
printf("Origin = %f, %f, %f\n", origin[0], origin[1], origin[2]);
"""
weave.inline(code, ['a'], include_dirs=inc_dirs, library_dirs=lib_dirs)
print "sys.getrefcount(a) = ", sys.getrefcount(a)
src/s/l/Slipy-Tractograhpy-HEAD/weave-local/examples/vtk_example.py Slipy-Tractograhpy(Download)
a = vtk.vtkStructuredPoints()
a.SetOrigin(1.0, 1.0, 1.0)
print "sys.getrefcount(a) = ", sys.getrefcount(a)
code=r"""
printf("a->ClassName() == %s\n", a->GetClassName());
printf("a->GetReferenceCount() == %d\n", a->GetReferenceCount());
double *origin = a->GetOrigin();
printf("Origin = %f, %f, %f\n", origin[0], origin[1], origin[2]);
"""
weave.inline(code, ['a'], include_dirs=inc_dirs, library_dirs=lib_dirs)
print "sys.getrefcount(a) = ", sys.getrefcount(a)
src/a/s/asciiporn-2009.05.01/asciiporn/weave/examples/vtk_example.py asciiporn(Download)
a = vtk.vtkStructuredPoints()
a.SetOrigin(1.0, 1.0, 1.0)
print "sys.getrefcount(a) = ", sys.getrefcount(a)
code=r"""
printf("a->ClassName() == %s\n", a->GetClassName());
printf("a->GetReferenceCount() == %d\n", a->GetReferenceCount());
double *origin = a->GetOrigin();
printf("Origin = %f, %f, %f\n", origin[0], origin[1], origin[2]);
"""
weave.inline(code, ['a'], include_dirs=inc_dirs, library_dirs=lib_dirs)
print "sys.getrefcount(a) = ", sys.getrefcount(a)
src/c/l/clearsilver-0.10.1/clearsilver/python/examples/base/who_calls.py clearsilver(Download)
o = getattr (m, sym)
if type(o) is types.ClassType:
name = "%s:%s" % (modname,o.__name__)
cnt = sys.getrefcount (o)
if base:
if set_base:
base[name] = cnt
src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/IronPython/27/Lib/site-packages/win32comext/axdebug/util.py ironruby(Download)
print key,
try:
ob = unwrap(key)
print ob, sys.getrefcount(ob)
except:
print "<error>"
src/d/a/daneel-ai-HEAD/schemepy/schemepy/oldguile/oldguile.py daneel-ai(Download)
print "DEL!!", self a = A() print 0, id(a), 'refs', sys.getrefcount(a) scm = PythonSMOB.new(a) print 1, scm, 'refs', sys.getrefcount(a) print 2, scm.type() b = scm.fromscheme() print 3, b print 4, a is b print 5, 'refs', sys.getrefcount(a)
del b gc.collect() print 6, 'refs', sys.getrefcount(a) del a gc.collect()
guile.scm_gc() guile.scm_gc() print 9, 'refs', sys.getrefcount(b) gc.collect() del b
src/t/p/tpserver-py-HEAD/schemepy/schemepy/oldguile/oldguile.py tpserver-py(Download)
print "DEL!!", self a = A() print 0, id(a), 'refs', sys.getrefcount(a) scm = PythonSMOB.new(a) print 1, scm, 'refs', sys.getrefcount(a) print 2, scm.type() b = scm.fromscheme() print 3, b print 4, a is b print 5, 'refs', sys.getrefcount(a)
del b gc.collect() print 6, 'refs', sys.getrefcount(a) del a gc.collect()
guile.scm_gc() guile.scm_gc() print 9, 'refs', sys.getrefcount(b) gc.collect() del b
src/s/c/schemepy-HEAD/schemepy/oldguile/oldguile.py schemepy(Download)
print "DEL!!", self a = A() print 0, id(a), 'refs', sys.getrefcount(a) scm = PythonSMOB.new(a) print 1, scm, 'refs', sys.getrefcount(a) print 2, scm.type() b = scm.fromscheme() print 3, b print 4, a is b print 5, 'refs', sys.getrefcount(a)
del b gc.collect() print 6, 'refs', sys.getrefcount(a) del a gc.collect()
guile.scm_gc() guile.scm_gc() print 9, 'refs', sys.getrefcount(b) gc.collect() del b
src/f/e/fey-HEAD/trunk/src/utils/CopyOnWrite.py fey(Download)
along with this program. If not, see <http://www.gnu.org/licenses/>. """ from sys import getrefcount from gc import get_referrers from fey.utils.Decorator import Decorator
# If there are more than the baseline
# references to its data...
refcount = getrefcount(field)
if refcount > 3:
if debug >= 1:
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next