Author: petdance
Date: Tue Jun 12 11:17:12 2007
New Revision: 18953
Modified:
trunk/config/gen/makefiles/root.in
trunk/include/parrot/sub.h
trunk/include/parrot/vtables.h
trunk/src/sub.c
trunk/src/vtables.c
Log:
headerized vtables.c
Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in (original)
+++ trunk/config/gen/makefiles/root.in Tue Jun 12 11:17:12 2007
@@ -1857,6 +1857,7 @@
src/string.o \
src/string_primitives.o \
src/utils.o \
+ src/vtables.o \
headerizer:
$(PERL) $(BUILD_TOOLS_DIR)/headerize.pl $(HEADERIZER_O_FILES)
Modified: trunk/include/parrot/sub.h
==============================================================================
--- trunk/include/parrot/sub.h (original)
+++ trunk/include/parrot/sub.h Tue Jun 12 11:17:12 2007
@@ -205,6 +205,9 @@
opcode_t *address;
} Parrot_Context_info;
+/* HEADERIZER BEGIN: src/sub.c */
+/* HEADERIZER END: src/sub.c */
+
struct Parrot_sub * new_sub(Interp * interp);
struct Parrot_sub * new_closure(Interp * interp);
struct Parrot_coro * new_coroutine(Interp * interp);
Modified: trunk/include/parrot/vtables.h
==============================================================================
--- trunk/include/parrot/vtables.h (original)
+++ trunk/include/parrot/vtables.h Tue Jun 12 11:17:12 2007
@@ -13,13 +13,32 @@
#ifndef PARROT_VTABLES_H_GUARD
#define PARROT_VTABLES_H_GUARD
-PARROT_API VTABLE *Parrot_new_vtable(Interp*);
-PARROT_API VTABLE *Parrot_clone_vtable(Interp*, const VTABLE *base_vtable);
-PARROT_API void Parrot_destroy_vtable(Interp*, VTABLE *vtable);
-
-void parrot_alloc_vtables(Interp *);
-void parrot_realloc_vtables(Interp *);
-void parrot_free_vtables(Interp *);
+
+/* HEADERIZER BEGIN: src/vtables.c */
+
+PARROT_API VTABLE * Parrot_clone_vtable( Interp *interp,
+ const VTABLE *base_vtable /*NN*/ )
+ __attribute__nonnull__(2)
+ __attribute__malloc__
+ __attribute__warn_unused_result__;
+
+PARROT_API void Parrot_destroy_vtable( Interp *interp,
+ VTABLE *vtable /*NULLOK*/ );
+
+PARROT_API VTABLE * Parrot_new_vtable( Interp *interp )
+ __attribute__malloc__
+ __attribute__warn_unused_result__;
+
+void parrot_alloc_vtables( Interp *interp /*NN*/ )
+ __attribute__nonnull__(1);
+
+void parrot_free_vtables( Interp *interp /*NN*/ )
+ __attribute__nonnull__(1);
+
+void parrot_realloc_vtables( Interp *interp /*NN*/ )
+ __attribute__nonnull__(1);
+
+/* HEADERIZER END: src/vtables.c */
#endif /* PARROT_VTABLES_H_GUARD */
Modified: trunk/src/sub.c
==============================================================================
--- trunk/src/sub.c (original)
+++ trunk/src/sub.c Tue Jun 12 11:17:12 2007
@@ -33,7 +33,7 @@
*/
void
-mark_context(Interp *interp, parrot_context_t* ctx)
+mark_context(Interp *interp, parrot_context_t* ctx /*NN*/)
{
PObj *obj;
int i;
Modified: trunk/src/vtables.c
==============================================================================
--- trunk/src/vtables.c (original)
+++ trunk/src/vtables.c Tue Jun 12 11:17:12 2007
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2001-2006, The Perl Foundation.
+Copyright (C) 2001-2007, The Perl Foundation.
$Id$
=head1 NAME
@@ -10,48 +10,41 @@
=head2 Functions
-=over 4
-
-=cut
-
*/
#include "parrot/parrot.h"
+#include "parrot/vtables.h"
+
+/* HEADER: include/parrot/vtables.h */
/*
-=item C<VTABLE *
-Parrot_new_vtable(Parrot_Interp interp)>
+FUNCDOC: Parrot_new_vtable
Creates and returns a pointer to the new C<VTABLE>.
-=cut
-
*/
+PARROT_API
VTABLE *
-Parrot_new_vtable(Parrot_Interp interp)
+Parrot_new_vtable(Interp *interp)
+ /* MALLOC, WARN_UNUSED */
{
return mem_allocate_zeroed_typed(VTABLE);
}
/*
-=item C<VTABLE *
-Parrot_clone_vtable(Parrot_Interp interp, const VTABLE *base_vtable)>
+FUNCDOC: Parrot_clone_vtable
Clones C<*base_vtable> and returns a pointer to the new C<VTABLE>.
-=item C<void
-Parrot_destroy_vtable(Parrot_Interp interp, VTABLE *vtable)>
-
-Destroys C<*vtable>.
-=cut
-
*/
+PARROT_API
VTABLE *
-Parrot_clone_vtable(Parrot_Interp interp, const VTABLE *base_vtable)
+Parrot_clone_vtable(Interp *interp, const VTABLE *base_vtable /*NN*/)
+ /* MALLOC, WARN_UNUSED */
{
VTABLE * const new_vtable = mem_allocate_typed(VTABLE);
if (new_vtable) {
@@ -61,8 +54,17 @@
}
+/*
+
+FUNCDOC: Parrot_destroy_vtable
+
+Destroys C<*vtable>.
+
+*/
+
+PARROT_API
void
-Parrot_destroy_vtable(Parrot_Interp interp, VTABLE *vtable)
+Parrot_destroy_vtable(Interp *interp, VTABLE *vtable /*NULLOK*/)
{
/* XXX We sometimes get a type number allocated without any corresponding
* vtable. E.g. if you load perl_group, perlscalar is this way.
@@ -75,7 +77,7 @@
}
void
-parrot_alloc_vtables(Interp *interp)
+parrot_alloc_vtables(Interp *interp /*NN*/)
{
interp->vtables =
(VTABLE **)mem_sys_allocate_zeroed(sizeof (VTABLE *) *
PARROT_MAX_CLASSES);
@@ -84,7 +86,7 @@
}
void
-parrot_realloc_vtables(Interp *interp)
+parrot_realloc_vtables(Interp *interp /*NN*/)
{
/* 16 bigger seems reasonable, though it's only a pointer
table and we could get bigger without blowing much memory
@@ -97,7 +99,7 @@
}
void
-parrot_free_vtables(Interp *interp)
+parrot_free_vtables(Interp *interp /*NN*/)
{
int i;
@@ -107,19 +109,6 @@
}
/*
-
-=back
-
-=head1 SEE ALSO
-
-F<include/parrot/vtables.h>.
-
-=cut
-
-*/
-
-
-/*
* Local variables:
* c-file-style: "parrot"
* End: