[svn:parrot] r38227 - trunk/src/pmc
bacek at svn.parrot.org
bacek at svn.parrot.org
Mon Apr 20 11:47:10 UTC 2009
Author: bacek
Date: Mon Apr 20 11:47:09 2009
New Revision: 38227
URL: https://trac.parrot.org/parrot/changeset/38227
Log:
Use VTABLE method instead of direct accessing attributes in FixedPMCArray.sort. Closes TT#218.
Modified:
trunk/src/pmc/fixedpmcarray.pmc
Modified: trunk/src/pmc/fixedpmcarray.pmc
==============================================================================
--- trunk/src/pmc/fixedpmcarray.pmc Mon Apr 20 08:34:50 2009 (r38226)
+++ trunk/src/pmc/fixedpmcarray.pmc Mon Apr 20 11:47:09 2009 (r38227)
@@ -47,7 +47,7 @@
const INTVAL n = SELF.elements();
if (n > 1)
- Parrot_quicksort(interp, (void **)PMC_array(SELF), n, cmp_func);
+ Parrot_quicksort(interp, (void **)SELF.get_pointer(), n, cmp_func);
}
/*
@@ -144,6 +144,20 @@
/*
+=item C<void *get_pointer()>
+
+Get pointer to stored data. Used in sort method.
+
+=cut
+
+*/
+
+ VTABLE void * get_pointer() {
+ return PMC_array(SELF);
+ }
+
+/*
+
=item C<INTVAL get_integer()>
Returns the number of elements in the array.
More information about the parrot-commits
mailing list