Skip to content

Commit

Permalink
[PMC] Cleaned up ParrotLibrary destroy().
Browse files Browse the repository at this point in the history
Also removed some unused POD sections.

git-svn-id: https://svn.parrot.org/parrot/trunk@48704 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
chromatic committed Aug 28, 2010
1 parent aa1a984 commit 07e7be9
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions src/pmc/parrotlibrary.pmc
@@ -1,5 +1,5 @@
/*
Copyright (C) 2001-2009, Parrot Foundation.
Copyright (C) 2001-2010, Parrot Foundation.
$Id$

=head1 NAME
Expand Down Expand Up @@ -49,9 +49,7 @@ Initializes the library with a C<NULL> oplib init function.

*/

VTABLE void init() {
PObj_custom_destroy_SET(SELF);
}
VTABLE void init() {}

/*

Expand Down Expand Up @@ -82,8 +80,14 @@ Creates and returns a clone of the library.

VTABLE PMC *clone() {
PMC * const dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type);
PMC_oplib_init(dest) = PMC_oplib_init(SELF);
PMC_dlhandle(dest) = PMC_dlhandle(SELF);

if (PMC_oplib_init(SELF))
PMC_oplib_init(dest) = PMC_oplib_init(SELF);

if (PMC_dlhandle(SELF)) {
PMC_dlhandle(dest) = PMC_dlhandle(SELF);
PObj_custom_destroy_SET(dest);
}

if (PMC_metadata(SELF))
PMC_metadata(dest) = VTABLE_clone(INTERP, PMC_metadata(SELF));
Expand Down Expand Up @@ -126,7 +130,7 @@ Returns the name of the loaded library.

=item C<void *get_pointer()>

Get the pointer to the shared library handle.
Gets the pointer to the shared library handle.

=cut

Expand All @@ -140,31 +144,22 @@ Get the pointer to the shared library handle.

=item C<void set_pointer(void *handle)>

Set the pointer to the shared library handle.
Sets the pointer to the shared library handle.

=cut

*/

VTABLE void set_pointer(void *handle) {
PMC_dlhandle(SELF) = handle;
PObj_custom_destroy_SET(SELF);
}
}

/*

=back

=head1 SEE ALSO

Date: Mon, 29 Sep 2003 14:37:11 -0400 (EDT)
Subject: Library loading and initialization sequence
From: Dan Sugalski

=head1 HISTORY

Initial version by leo 2003.10.12.

=cut

*/
Expand Down

0 comments on commit 07e7be9

Please sign in to comment.