cvsuser 04/09/10 01:54:50
Modified: classes delegate.pmc
config/gen/makefiles root.in
include/parrot caches.h memory.h
src memory.c
Log:
misc fixes
* make it compile - Makefile typo
* remove constness warnings
* turn off return continuation and stack frame recycling
* readd accidental backed out function
Revision Changes Path
1.31 +22 -2 parrot/classes/delegate.pmc
Index: delegate.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/delegate.pmc,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -w -r1.30 -r1.31
--- delegate.pmc 9 Sep 2004 18:45:37 -0000 1.30
+++ delegate.pmc 10 Sep 2004 08:54:45 -0000 1.31
@@ -1,6 +1,6 @@
/*
Copyright: 2003 The Perl Foundation. All Rights Reserved.
-$Id: delegate.pmc,v 1.30 2004/09/09 18:45:37 dan Exp $
+$Id: delegate.pmc,v 1.31 2004/09/10 08:54:45 leo Exp $
=head1 NAME
@@ -152,7 +152,15 @@
=item C<void init()>
-Calls the delegated C<init()> method.
+Calls the delegated C<__init()> method if it exists.
+
+=item C<PMC* new_extended()>
+
+Calls the delegated C<__new_extended> method if it exists.
+
+XXX Actually the PMC compiler should emit different code, if a method is
+present in classes/default.pmc. Some defaulted methods like this one have
+useful defaults and don't throw exceptiions.
=cut
@@ -169,6 +177,18 @@
void destroy() {
/* don't delegate destroy */
}
+
+ PMC* new_extended() {
+ STRING *meth = const_string(interpreter,
+ PARROT_VTABLE_NEW_EXTENDED_METHNAME );
+ PMC *sub = find_meth(interpreter, SELF, meth);
+ if (PMC_IS_NULL(sub)) {
+ /* run default fallback that constructs an empty object */
+ return SUPER();
+ }
+ return (PMC*) Parrot_run_meth_fromc_args_save(interpreter, sub,
+ pmc, meth, "P");
+ }
}
/*
1.236 +2 -2 parrot/config/gen/makefiles/root.in
Index: root.in
===================================================================
RCS file: /cvs/public/parrot/config/gen/makefiles/root.in,v
retrieving revision 1.235
retrieving revision 1.236
diff -u -w -r1.235 -r1.236
--- root.in 9 Sep 2004 18:45:39 -0000 1.235
+++ root.in 10 Sep 2004 08:54:47 -0000 1.236
@@ -1,4 +1,4 @@
-# $Id: root.in,v 1.235 2004/09/09 18:45:39 dan Exp $
+# $Id: root.in,v 1.236 2004/09/10 08:54:47 leo Exp $
###############################################################################
#
@@ -795,7 +795,7 @@
$(SRC)/inter_cb.str
$(SRC)/inter_misc$(O) : $(SRC)/inter_misc.c $(GENERAL_H_FILES) \
- $(SRC)/inter_misc.src
+ $(SRC)/inter_misc.str
$(SRC)/inter_create$(O) : $(SRC)/inter_create.c $(GENERAL_H_FILES)
1.7 +4 -2 parrot/include/parrot/caches.h
Index: caches.h
===================================================================
RCS file: /cvs/public/parrot/include/parrot/caches.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -r1.6 -r1.7
--- caches.h 4 May 2004 12:40:49 -0000 1.6
+++ caches.h 10 Sep 2004 08:54:49 -0000 1.7
@@ -1,7 +1,7 @@
/* caches.h
* Copyright: 2001-2004 The Perl Foundation. All Rights Reserved.
* CVS Info
- * $Id: caches.h,v 1.6 2004/05/04 12:40:49 leo Exp $
+ * $Id: caches.h,v 1.7 2004/09/10 08:54:49 leo Exp $
* Overview:
* Cache and direct freelist handling for various items.
* Data Structure and Algorithms:
@@ -14,7 +14,9 @@
#define PARROT_CACHES_H_GUARD
#define DISABLE_METH_CACHE 0
-#define DISABLE_RETC_RECYCLING 0
+
+/* turn off this hack, we need something better */
+#define DISABLE_RETC_RECYCLING 1
/*
* object method cache entry
1.17 +5 -5 parrot/include/parrot/memory.h
Index: memory.h
===================================================================
RCS file: /cvs/public/parrot/include/parrot/memory.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -w -r1.16 -r1.17
--- memory.h 8 Sep 2004 00:33:54 -0000 1.16
+++ memory.h 10 Sep 2004 08:54:49 -0000 1.17
@@ -1,7 +1,7 @@
/* memory.h
* Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
* CVS Info
- * $Id: memory.h,v 1.16 2004/09/08 00:33:54 dan Exp $
+ * $Id: memory.h,v 1.17 2004/09/10 08:54:49 leo Exp $
* Overview:
* This is the api header for the memory subsystem
* Data Structure and Algorithms:
@@ -21,16 +21,16 @@
#define mem_sys_realloc(x,y) (assert(x!=NULL), mem__sys_realloc(x,y))
void mem_sys_free(void *);
-void *mem__internal_allocate(size_t, char *, int);
+void *mem__internal_allocate(size_t, const char *, int);
#define mem_internal_allocate(x) mem__internal_allocate(x, __FILE__, __LINE__)
-void *mem__internal_allocate_zeroed(size_t, char *, int);
+void *mem__internal_allocate_zeroed(size_t, const char *, int);
#define mem_internal_allocate_zeroed(x) mem__internal_allocate_zeroed(x, __FILE__,
__LINE__)
-void *mem__internal_realloc(void *, size_t, char *, int);
+void *mem__internal_realloc(void *, size_t, const char *, int);
#define mem_internal_realloc(x, y) mem__internal_realloc(x, y, __FILE__, __LINE__)
-void mem__internal_free(void *, char *, int);
+void mem__internal_free(void *, const char *, int);
#define mem_internal_free(x) mem__internal_free(x, __FILE__, __LINE__)
1.47 +5 -5 parrot/src/memory.c
Index: memory.c
===================================================================
RCS file: /cvs/public/parrot/src/memory.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -w -r1.46 -r1.47
--- memory.c 8 Sep 2004 00:33:58 -0000 1.46
+++ memory.c 10 Sep 2004 08:54:50 -0000 1.47
@@ -1,6 +1,6 @@
/*
Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-$Id: memory.c,v 1.46 2004/09/08 00:33:58 dan Exp $
+$Id: memory.c,v 1.47 2004/09/10 08:54:50 leo Exp $
=head1 NAME
@@ -50,7 +50,7 @@
}
void *
-mem__internal_allocate(size_t size, char *file, int line)
+mem__internal_allocate(size_t size, const char *file, int line)
{
void *ptr = malloc((size_t)size);
#ifdef DETAIL_MEMORY_DEBUG
@@ -85,7 +85,7 @@
}
void *
-mem__internal_allocate_zeroed(size_t size, char *file, int line)
+mem__internal_allocate_zeroed(size_t size, const char *file, int line)
{
void *ptr = calloc(1, (size_t)size);
if (!ptr)
@@ -124,7 +124,7 @@
}
void *
-mem__internal_realloc(void *from, size_t size, char *file, int line)
+mem__internal_realloc(void *from, size_t size, const char *file, int line)
{
void *ptr = realloc(from, size);
if (!ptr)
@@ -158,7 +158,7 @@
}
void
-mem__internal_free(void *from, char *file, int line)
+mem__internal_free(void *from, const char *file, int line)
{
#ifdef DETAIL_MEMORY_DEBUG
printf("Internal free of %p (%s/%d)\n", from, file, line);