[svn:parrot] r37985 - branches/packfile_revamp/src/pmc

bacek at svn.parrot.org bacek at svn.parrot.org
Wed Apr 8 23:44:00 UTC 2009


Author: bacek
Date: Wed Apr  8 23:43:59 2009
New Revision: 37985
URL: https://trac.parrot.org/parrot/changeset/37985

Log:
Add PackfileConstantTable.init method which allocates PackFile_ConstTable.

Will be reimplemented soon to avoid memory leaks. But for now it allows
set_*_int methods works on fresh PackfileConstantTable.

Modified:
   branches/packfile_revamp/src/pmc/packfileconstanttable.pmc

Modified: branches/packfile_revamp/src/pmc/packfileconstanttable.pmc
==============================================================================
--- branches/packfile_revamp/src/pmc/packfileconstanttable.pmc	Wed Apr  8 23:43:39 2009	(r37984)
+++ branches/packfile_revamp/src/pmc/packfileconstanttable.pmc	Wed Apr  8 23:43:59 2009	(r37985)
@@ -76,6 +76,23 @@
 
 pmclass PackfileConstantTable extends PackfileSegment {
 
+/*
+
+=item C<init>
+
+Create empty PackfileConstantTable.
+
+=cut
+
+FIXME: It will leak created PackFile_ConstTable.
+
+*/
+
+    VTABLE void init() {
+        PackFile_ConstTable * table = 
+            mem_allocate_zeroed_typed(PackFile_ConstTable);
+        PMC_data(SELF) = table;
+    }
 
 /*
 


More information about the parrot-commits mailing list