/*
Copyright (C) 2004, The Perl Foundation.
$Id: vtablecache.pmc 16275 2006-12-28 01:20:44Z particle $

=head1 NAME

src/pmc/vtablecache.pmc - Hold a vtable pointer for later use

=head1 DESCRIPTION

PMC class to hold a vtable pointer. When this PMC is disposed of, the
vtable is freed.

=cut

*/

#include "parrot/parrot.h"

pmclass VtableCache {

    void init() {
        PMC_struct_val(SELF) = NULL;
        PObj_active_destroy_SET(SELF);
    }

    void destroy() {
        if (NULL != PMC_struct_val(SELF)) {
            Parrot_destroy_vtable(INTERP, PMC_struct_val(SELF));
        }
    }

}

/*
 * Local variables:
 *   c-file-style: "parrot"
 * End:
 * vim: expandtab shiftwidth=4:
 */
