Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
switch two PMCs to auto_attrs. Patch courtesy of Vasily Chekalkin
  • Loading branch information
moritz committed May 4, 2010
1 parent e3153ad commit 124895a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
13 changes: 3 additions & 10 deletions src/pmc/mutablevar.pmc
Expand Up @@ -19,7 +19,7 @@ needed as scalar containers forward to their contents.

#include "parrot/parrot.h"

pmclass MutableVAR need_ext dynpmc group perl6_group manual_attrs {
pmclass MutableVAR need_ext dynpmc group perl6_group auto_attrs {
ATTR PMC *scalar;

VTABLE void init() {
Expand All @@ -28,12 +28,10 @@ pmclass MutableVAR need_ext dynpmc group perl6_group manual_attrs {
}

VTABLE void init_pmc(PMC *scalar) {
/* Need custom mark and destroy. */
/* Need custom mark. */
PObj_custom_mark_SET(SELF);
PObj_custom_destroy_SET(SELF);

/* Create underlying structure and set scalar value. */
PMC_data(SELF) = mem_allocate_zeroed_typed(Parrot_MutableVAR_attributes);
/* Set scalar value */
SET_ATTR_scalar(INTERP, SELF, scalar);
}

Expand All @@ -44,11 +42,6 @@ pmclass MutableVAR need_ext dynpmc group perl6_group manual_attrs {
Parrot_gc_mark_PMC_alive(INTERP, scalar);
}

VTABLE void destroy() {
mem_sys_free(PMC_data(SELF));
PMC_data(SELF) = NULL;
}

VTABLE PMC* getprop(STRING *prop_name) {
PMC *scalar;
GET_ATTR_scalar(INTERP, SELF, scalar);
Expand Down
9 changes: 1 addition & 8 deletions src/pmc/p6invocation.pmc
Expand Up @@ -135,7 +135,7 @@ static PMC *get_next_candidate(PARROT_INTERP, PMC *SELF, int check_only, INTVAL
return current;
}

pmclass P6Invocation need_ext dynpmc group perl6_group manual_attrs {
pmclass P6Invocation need_ext dynpmc group perl6_group auto_attrs {
ATTR PMC *first_candidate;
ATTR PMC *candidate_list;
ATTR STRING *name;
Expand All @@ -144,9 +144,7 @@ pmclass P6Invocation need_ext dynpmc group perl6_group manual_attrs {
ATTR INTVAL position;

VTABLE void init() {
PMC_data(SELF) = mem_allocate_zeroed_typed(Parrot_P6Invocation_attributes);
PObj_custom_mark_SET(SELF);
PObj_custom_destroy_SET(SELF);
}

VTABLE void init_pmc(PMC *list) {
Expand All @@ -173,11 +171,6 @@ pmclass P6Invocation need_ext dynpmc group perl6_group manual_attrs {
}
}

VTABLE void destroy() {
mem_sys_free(PMC_data(SELF));
PMC_data(SELF) = NULL;
}

VTABLE PMC *clone() {
PMC *first_candidate, *candidate_list, *search_list;
STRING *name;
Expand Down

0 comments on commit 124895a

Please sign in to comment.