Author: Ronan Lamy <[email protected]>
Branch: ClassRepr
Changeset: r73917:3e758488822c
Date: 2014-10-13 15:40 +0100
http://bitbucket.org/pypy/pypy/changeset/3e758488822c/
Log: create ClassRepr.init_vtable()
diff --git a/rpython/rtyper/rclass.py b/rpython/rtyper/rclass.py
--- a/rpython/rtyper/rclass.py
+++ b/rpython/rtyper/rclass.py
@@ -290,14 +290,18 @@
def getvtable(self):
"""Return a ptr to the vtable of this type."""
if self.vtable is None:
- self.vtable = malloc(self.vtable_type, immortal=True)
- self.setup_vtable(self.vtable, self)
+ self.init_vtable()
return cast_vtable_to_typeptr(self.vtable)
def getruntime(self, expected_type):
assert expected_type == CLASSTYPE
return self.getvtable()
+ def init_vtable(self):
+ """Create the actual vtable"""
+ self.vtable = malloc(self.vtable_type, immortal=True)
+ self.setup_vtable(self.vtable, self)
+
def setup_vtable(self, vtable, rsubcls):
"""Initialize the 'self' portion of the 'vtable' belonging to the
given subclass."""
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit