Skip to content

Commit

Permalink
ATTR alloc/free isn't needed with auto_attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
cotto committed Feb 22, 2011
1 parent 24aff85 commit c373c86
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions src/pmc/select.pmc
Expand Up @@ -109,33 +109,12 @@ Initializes the PMC.

VTABLE void init() {
PMC *fd_map = pmc_new(interp, enum_class_Hash);
Parrot_Select_attributes * const attrs =
mem_gc_allocate_zeroed_typed(INTERP, Parrot_Select_attributes);
PMC_data(SELF) = attrs;
SET_ATTR_fd_map(INTERP, SELF, fd_map);
SET_ATTR_maxfd(INTERP, SELF, -1);

FD_ZERO(&(PARROT_SELECT(SELF)->rb_array));
FD_ZERO(&(PARROT_SELECT(SELF)->wb_array));
FD_ZERO(&(PARROT_SELECT(SELF)->eb_array));
PObj_custom_destroy_SET(SELF);
}

/*

=item C<void destroy()>

Destroys the PMC.

=cut

*/

VTABLE void destroy() {
if (PMC_data(SELF)) {
mem_gc_free(INTERP, PMC_data(SELF));
PMC_data(SELF) = NULL;
}
}

/*
Expand Down

0 comments on commit c373c86

Please sign in to comment.