[svn:parrot] r45157 - trunk/docs

NotFound at svn.parrot.org NotFound at svn.parrot.org
Wed Mar 24 17:08:13 UTC 2010


Author: NotFound
Date: Wed Mar 24 17:08:13 2010
New Revision: 45157
URL: https://trac.parrot.org/parrot/changeset/45157

Log:
[doc] mention auto/manual_attrs in pmc.doc, by suggestion from cotto++

Modified:
   trunk/docs/pmc.pod

Modified: trunk/docs/pmc.pod
==============================================================================
--- trunk/docs/pmc.pod	Wed Mar 24 16:56:13 2010	(r45156)
+++ trunk/docs/pmc.pod	Wed Mar 24 17:08:13 2010	(r45157)
@@ -37,11 +37,19 @@
 generate a struct containing all ATTRs, including those inherited via
 C<extends> declarations.  This struct will be named in the form
 C<Parrot_x_attributes>, where C<x> is the name of your PMC, e.g.
-C<Parrot_FixedIntegerArray_attributes>.  When creating a PMC that has one or
-more ATTRs, the C<Parrot_x_attributes> struct must be allocated and assigned to
-C<PMC_data> in the PMC's C<init()> and C<init_pmc()> VTABLE functions (if used)
-and it must be destroyed in the C<destroy()> VTABLE function.  PMCs with ATTRs
-also need to indicate that they need active destruction by calling
+C<Parrot_FixedIntegerArray_attributes>. 
+
+When creating a PMC that has one or more ATTRs, the C<Parrot_x_attributes>
+struct must be allocated and assigned to C<PMC_data>, and freed on PMC
+destruction. This can be done automatically by using the auto_attrs flag in
+the PMC declaration, or manually by using the manual_attrs flag. You must set
+one of those flags, a warning is emitted otherwise. In future releases
+auto_attrs will be the default.
+
+If manual_attrs is specified or assumed the struct must be manually allocated
+in the PMC's C<init()> and C<init_pmc()> VTABLE functions (if used)
+and it must be destroyed in the C<destroy()> VTABLE function, the PMC must
+also indicate that they need active destruction by calling
 C<PObj_custom_destroy_SET()> or C<PObj_custom_mark_destroy_SETALL()>.
 
 If your PMC only needs to store a single pointer, it can use C<PMC_data> directly.


More information about the parrot-commits mailing list