[pypy-svn] r23107 - pypy/dist/pypy/rpython/memory
cfbolz at codespeak.net
cfbolz at codespeak.net
Tue Feb 7 14:42:44 CET 2006
Author: cfbolz
Date: Tue Feb 7 14:42:42 2006
New Revision: 23107
Modified:
pypy/dist/pypy/rpython/memory/gctransform.py
Log:
yay, remove some of this horrible stuff! it seems like you can call function
pointers directly (thanks armin)
Modified: pypy/dist/pypy/rpython/memory/gctransform.py
==============================================================================
--- pypy/dist/pypy/rpython/memory/gctransform.py (original)
+++ pypy/dist/pypy/rpython/memory/gctransform.py Tue Feb 7 14:42:42 2006
@@ -294,16 +294,6 @@
destrptr = None
if destrptr is not None:
- const_destrptr = Constant(destrptr)
- const_destrptr.concretetype = lltype.typeOf(destrptr)
- def compute_call_del_ops(hop):
- hop.exception_is_here()
- return hop.genop("direct_call", [const_destrptr, hop.args_v[1]],
- resulttype=lltype.Void)
- def call_del(var):
- pass
- call_del.compute_ll_ops = compute_call_del_ops
- call_del.llresult = lltype.Void
body = '\n'.join(self._static_deallocator_body_for_type('v', TYPE, 2))
src = """
def deallocator(addr):
@@ -312,7 +302,7 @@
# refcount is at zero, temporarily bump it to 1:
gcheader.signed[0] = 1
try:
- call_del(v)
+ destrptr(v)
except Exception:
os.write(0, "a destructor raised an exception, ignoring it")
refcount = gcheader.signed[0] - 1
@@ -326,9 +316,9 @@
body = '\n'.join(self._static_deallocator_body_for_type('v', TYPE))
src = ('def deallocator(addr):\n v = cast_adr_to_ptr(addr, PTR_TYPE)\n' +
body + '\n destroy(v)\n')
- d = {'pop_alive':pop_alive,
- 'destroy':destroy,
- 'call_del': call_del,
+ d = {'pop_alive': pop_alive,
+ 'destroy': destroy,
+ 'destrptr': destrptr,
'gc_header_offset': RefcountingGCTransformer.gc_header_offset,
'cast_adr_to_ptr': objectmodel.cast_adr_to_ptr,
'PTR_TYPE': lltype.Ptr(TYPE),
More information about the Pypy-commit
mailing list