[svn:parrot] r42025 - in trunk: . config/auto config/gen/makefiles docs include/parrot lib/Parrot/Docs/Section src/gc t/codingstd
darbelo at svn.parrot.org
darbelo at svn.parrot.org
Thu Oct 22 21:42:09 UTC 2009
Author: darbelo
Date: Thu Oct 22 21:42:07 2009
New Revision: 42025
URL: https://trac.parrot.org/parrot/changeset/42025
Log:
Remove unused file src/gc/res_lea.c and cleanup mentions in the documentation.
Deleted:
trunk/src/gc/res_lea.c
Modified:
trunk/MANIFEST
trunk/config/auto/gc.pm
trunk/config/gen/makefiles/root.in
trunk/docs/memory_internals.pod
trunk/include/parrot/pobj.h
trunk/lib/Parrot/Docs/Section/C.pm
trunk/src/gc/api.c
trunk/t/codingstd/c_function_docs.t
Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST Thu Oct 22 19:38:20 2009 (r42024)
+++ trunk/MANIFEST Thu Oct 22 21:42:07 2009 (r42025)
@@ -1,7 +1,7 @@
# ex: set ro:
# $Id$
#
-# generated by tools/dev/mk_manifest_and_skip.pl Wed Oct 21 21:41:02 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Thu Oct 22 19:52:39 2009 UT
#
# See below for documentation on the format of this file.
#
@@ -1280,7 +1280,6 @@
src/gc/malloc.c []
src/gc/malloc_trace.c []
src/gc/mark_sweep.c []
-src/gc/res_lea.c []
src/gc/system.c []
src/global.c []
src/global_setup.c []
Modified: trunk/config/auto/gc.pm
==============================================================================
--- trunk/config/auto/gc.pm Thu Oct 22 19:38:20 2009 (r42024)
+++ trunk/config/auto/gc.pm Thu Oct 22 21:42:07 2009 (r42025)
@@ -13,26 +13,10 @@
F<src/gc/alloc_resources.c>.
In the future, we will have a C<--gc> command-line option which will enable
-the configurer to choose among the default and:
+the configurer to choose among several garbage colectors.
=over 4
-=item C<libc>
-
-Use the C library C<malloc> along with F<src/gc/res_lea.c>.
-This doesn't currently work. See [perl #42774].
-
-=item C<malloc>
-
-Use the malloc in F<src/gc/malloc.c> along with F<src/gc/res_lea.c>.
-Since this uses res_lea.c, it doesn't currently work either. See [perl #42774].
-
-=item C<malloc-trace>
-
-Use the malloc in F<src/gc/malloc-trace.c> with tracing enabled, along
-with F<src/gc/res_lea.c>.
-Since this uses res_lea.c, it doesn't work currently either. See [perl #42774].
-
=back
=cut
Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in Thu Oct 22 19:38:20 2009 (r42024)
+++ trunk/config/gen/makefiles/root.in Thu Oct 22 21:42:07 2009 (r42025)
@@ -1088,8 +1088,6 @@
$(SRC_DIR)/gc/alloc_resources$(O) : $(GENERAL_H_FILES)
-$(SRC_DIR)/gc/res_lea$(O) : $(GENERAL_H_FILES)
-
$(SRC_DIR)/hll$(O) : $(GENERAL_H_FILES) $(SRC_DIR)/hll.str
$(SRC_DIR)/platform$(O) : $(GENERAL_H_FILES)
@@ -2225,7 +2223,6 @@
@ctags@ -e \
--links=no --totals \
-R --exclude=blib --exclude=.svn \
- --exclude=res_lea.c \
--languages=c,perl --langmap=c:+.h,c:+.pmc,c:+.ops \
-I NOTNULL,NULLOK,ARGIN,ARGMOD,ARGOUT,ARGINOUT,ARGIN_NULLOK,ARGOUT_NULLOK,ARGMOD_NULLOK \
$(CUR_DIR)
@@ -2246,7 +2243,6 @@
@ctags@ \
--links=no --totals \
-R --exclude=blib --exclude=.svn \
- --exclude=res_lea.c \
--languages=c,perl --langmap=c:+.h,c:+.pmc,c:+.ops \
-I NOTNULL,NULLOK,ARGIN,ARGMOD,ARGOUT,ARGINOUT,ARGIN_NULLOK,ARGOUT_NULLOK,ARGMOD_NULLOK \
$(CUR_DIR)
Modified: trunk/docs/memory_internals.pod
==============================================================================
--- trunk/docs/memory_internals.pod Thu Oct 22 19:38:20 2009 (r42024)
+++ trunk/docs/memory_internals.pod Thu Oct 22 21:42:07 2009 (r42025)
@@ -247,7 +247,7 @@
=head1 FILES
src/gc/api.c, src/gc/gc_private.h, pobj.h, mark_sweep.[ch],
-alloc_resources.[ch], res_lea.c, string.[ch]. Other garbage collector
+alloc_resources.[ch], string.[ch]. Other garbage collector
implementations may use separate files as well.
=head1 BUGS
Modified: trunk/include/parrot/pobj.h
==============================================================================
--- trunk/include/parrot/pobj.h Thu Oct 22 19:38:20 2009 (r42024)
+++ trunk/include/parrot/pobj.h Thu Oct 22 21:42:07 2009 (r42025)
@@ -41,19 +41,14 @@
be suitably aligned. The start of the memory region (as returned by malloc())
is suitably aligned for any use. If, for example, malloc() returns
objects aligned on 8-byte boundaries, and obj->bufstart is also aligned
-on 8-byte boundaries, then there should be 4 bytes of padding. It is
-handled differently in the two files alloc_resources.c and res_lea.c.
-In alloc_resources.c, the buffer is carved out of a larger memory pool. In
-res_lea.c, each buffer is individually allocated.
-
- src/gc/alloc_resources.c: src/gc/res_lea.c:
-
-ptr from malloc -> +------------------+ +------------------+
- [other blocks?] | INTVAL ref_count |
- | INTVAL ref_count | | possible padding |
-obj->bufstart -> +------------------+ +------------------+
- | data | | data |
- v v v v
+on 8-byte boundaries, then there should be 4 bytes of padding.
+
+ptr from malloc -> +------------------+
+ [other blocks?] |
+ | INTVAL ref_count |
+obj->bufstart -> +------------------+
+ | data |
+ v v
*/
Modified: trunk/lib/Parrot/Docs/Section/C.pm
==============================================================================
--- trunk/lib/Parrot/Docs/Section/C.pm Thu Oct 22 19:38:20 2009 (r42024)
+++ trunk/lib/Parrot/Docs/Section/C.pm Thu Oct 22 21:42:07 2009 (r42025)
@@ -229,11 +229,6 @@
$self->c_pair_item( '', 'memory' ),
$self->c_source_item( '', 'malloc' ),
$self->c_source_item( '', 'malloc-trace' ),
- $self->c_item(
- '',
- 'pairs' => ['resources'],
- 'sources' => ['res_lea']
- ),
$self->c_source_item( '', 'mark_sweep' ),
),
$self->new_group(
Modified: trunk/src/gc/api.c
==============================================================================
--- trunk/src/gc/api.c Thu Oct 22 19:38:20 2009 (r42024)
+++ trunk/src/gc/api.c Thu Oct 22 21:42:07 2009 (r42025)
@@ -71,13 +71,11 @@
This file implements logic for tracing processor registers and the system stack.
Here there be dragons.
-=item F<src/gc/res_lea.c>
-
=item F<src/gc/malloc.c>
=item F<src/gc/malloc_trace.c>
-These three files implement various unused features, including a custom malloc
+These two files implement various unused features, including a custom malloc
implementation, and malloc wrappers for various purposes. These are unused.
=back
Deleted: trunk/src/gc/res_lea.c
==============================================================================
--- trunk/src/gc/res_lea.c Thu Oct 22 21:42:07 2009 (r42024)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,305 +0,0 @@
-/*
-Copyright (C) 2001-2008, Parrot Foundation.
-$Id$
-
-=head1 NAME
-
-src/gc/res_lea.c - Resource allocation using malloc
-
-=head1 DESCRIPTION
-
-This file provides alternative implementations of memory allocation
-function found in F<src/resources.c>. It is used if F<Configure.pl> is
-passed the C<--gc=malloc> or C<--gc=malloc-trace> options.
-
-The "lea" in the file name refers to Doug Lea, who wrote malloc
-implementation found in F<src/malloc.c>.
-
-As of May 14, 2007, it doesn't work (and hasn't worked for some
-time.) The problem appears to be related to strings, but actually
-could be somewhere else. This allocator does not support any of
-Parrot's Copy-on-Write schemes. Nor does the string allocator
-handle "external" strings.
-
-=head2 Functions
-
-=over 4
-
-=cut
-
-*/
-
-#include "parrot/parrot.h"
-
-/*
-
-=item C<void Parrot_gc_compact_memory_pool(PARROT_INTERP)>
-
-Does nothing other than increment the interpreter's C<gc_collect_runs>
-count.
-
-=cut
-
-*/
-
-void
-Parrot_gc_compact_memory_pool(PARROT_INTERP)
-{
- ASSERT_ARGS(parrot_go_collect)
- if (interp->mem_pools->gc_sweep_block_level) {
- return;
- }
- interp->mem_pools->gc_collect_runs++; /* fake it */
-}
-
-/*
-
-=item C<static PARROT_INLINE void* xmalloc(size_t size)>
-
-Obtains the memory from C<malloc()> and returns it. Panics if there is
-no memory available.
-
-=cut
-
-*/
-
-static PARROT_INLINE void*
-xmalloc(size_t size)
-{
- ASSERT_ARGS(xmalloc)
- void *p = malloc(size);
- if (!p)
- do_panic(NULL, "malloc: out of mem", __FILE__, __LINE__);
- return p;
-}
-
-/*
-
-=item C<static PARROT_INLINE void* xcalloc(size_t n, size_t size)>
-
-Obtains the memory from C<calloc()> and returns it. Panics if there is
-no memory available.
-
-=cut
-
-*/
-
-static PARROT_INLINE void*
-xcalloc(size_t n, size_t size)
-{
- ASSERT_ARGS(xcalloc)
- void * const p = calloc(n, size);
- if (!p)
- do_panic(NULL, "calloc: out of mem", __FILE__, __LINE__);
- return p;
-}
-
-/*
-
-=item C<static PARROT_INLINE void* xrealloc(void *p, size_t size)>
-
-Reallocates the memory with C<realloc()> and returns it. Panics if there
-is no memory available.
-
-=cut
-
-*/
-
-static PARROT_INLINE void*
-xrealloc(void *p, size_t size)
-{
- ASSERT_ARGS(xrealloc)
- void * const n = realloc(p, size);
- if (!n)
- do_panic(NULL, "realloc: out of mem", __FILE__, __LINE__);
- return n;
-}
-
-/*
-
-=item C<void Parrot_gc_reallocate_buffer_storage(PARROT_INTERP, Buffer *buffer, size_t newsize)>
-
-COWable objects (strings or Buffers) use an INTVAL before C<bufstart> for
-refcounting in GC.
-
-=cut
-
-*/
-
-void
-Parrot_gc_reallocate_buffer_storage(PARROT_INTERP, Buffer *buffer, size_t newsize)
-{
- ASSERT_ARGS(parrot_reallocate)
- const size_t oldlen = PObj_buflen(buffer);
- Buffer_alloc_unit *p;
-
- if (!PObj_bufstart(buffer)) {
- Parrot_gc_allocate_buffer_storage_aligned(interp, buffer, newsize);
- /* The previous version zeroed the memory here, but I'm not
- sure why. */
- memset(PObj_bufstart(buffer), 0, newsize);
- }
- else {
- if (!newsize) { /* realloc(3) does free, if newsize == 0 here */
- return; /* do nothing */
- }
- p = (Buffer_alloc_unit *) xrealloc(PObj_bufallocstart(buffer),
- Buffer_alloc_offset + newsize);
- if (newsize > oldlen)
- memset((char *)p->buffer + oldlen, 0, newsize - oldlen);
- PObj_bufstart(buffer) = p->buffer;
- PObj_buflen(buffer) = newsize;
- }
-}
-
-
-/*
-
-=item C<void Parrot_gc_allocate_buffer_storage_aligned(PARROT_INTERP,
-Buffer *buffer, size_t size)>
-
-Allocate buffer memory for the given Buffer pointer. The C<size>
-has to be a multiple of the word size.
-C<PObj_buflen> will be set to exactly the given C<size>.
-See the comments and diagram in resources.c.
-
-This was never called anyway, so it isn't implemented here.
-
-=item C<void Parrot_gc_allocate_buffer_storage_aligned(PARROT_INTERP, Buffer *buffer,
-size_t size)>
-
-Like above, except the address of the buffer is guaranteed to be
-suitably aligned for holding anything contained in UnionVal
-(such as FLOATVAL).
-
-=cut
-
-*/
-
-void
-Parrot_gc_allocate_buffer_storage_aligned(PARROT_INTERP, Buffer *buffer, size_t size)
-{
- ASSERT_ARGS(parrot_allocate_aligned)
- Buffer_alloc_unit *p;
- p = (Buffer_alloc_unit *) xmalloc(Buffer_alloc_offset + size);
- p->ref_count = 0;
- PObj_bufstart(buffer) = p->buffer;
- PObj_buflen(buffer) = size;
-}
-
-/*
-
-=item C<void Parrot_gc_reallocate_string_storage(PARROT_INTERP, STRING *str, size_t newsize)>
-
-Reallocates the string buffer in C<*str> and returns it. C<newsize> is the
-number of bytes memory required.
-
-=cut
-
-*/
-
-void
-Parrot_gc_reallocate_string_storage(PARROT_INTERP, STRING *str, size_t newsize)
-{
- ASSERT_ARGS(parrot_reallocate_string)
- Buffer_alloc_unit *p;
-
- if (!PObj_bufstart(str)) {
- Parrot_gc_allocate_string_storage(interp, str, newsize);
- }
- else if (newsize) {
- p = (Buffer_alloc_unit *) xrealloc(PObj_bufallocstart(str),
- Buffer_alloc_offset + newsize);
- PObj_bufstart(str) = str->strstart = (char *) p->buffer;
- PObj_buflen(str) = newsize;
- }
-}
-
-/*
-
-=item C<void Parrot_gc_allocate_string_storage(PARROT_INTERP, STRING *str, size_t size)>
-
-Allocates the string buffer in C<*str> and returns it. C<size> is the
-number bytes of memory required.
-
-=cut
-
-*/
-
-void
-Parrot_gc_allocate_string_storage(PARROT_INTERP, STRING *str, size_t size)
-{
- ASSERT_ARGS(Parrot_gc_allocate_string_storage)
- Buffer_alloc_unit *p;
- p = (Buffer_alloc_unit *) xcalloc(Buffer_alloc_offset + size, 1);
- p->ref_count = 0;
- PObj_bufstart(str) = str->strstart = (char *) p->buffer;
- PObj_buflen(str) = size;
-}
-
-/*
-
-=item C<void initialize_var_size_pools(PARROT_INTERP)>
-
-Does nothing.
-
-=cut
-
-*/
-
-void
-initialize_var_size_pools(PARROT_INTERP)
-{
- ASSERT_ARGS(parrot_initialize_var_size_pools)
-}
-
-/*
-
-=item C<void Parrot_gc_merge_memory_pools(Interp *dest, Interp *source)>
-
-Does nothing.
-
-=cut
-
-*/
-void
-Parrot_gc_merge_memory_pools(Interp *dest, Interp *source)
-{
- ASSERT_ARGS(parrot_merge_memory_pools)
-}
-
-/*
-
-=item C<void Parrot_gc_destroy_memory_pools(PARROT_INTERP)>
-
-Does nothing.
-
-=cut
-
-*/
-
-void
-Parrot_gc_destroy_memory_pools(PARROT_INTERP)
-{
- ASSERT_ARGS(parrot_destroy_memory_pools)
-}
-
-/*
-
-=back
-
-=head1 SEE ALSO
-
-F<config/auto/gc.pl>, F<src/malloc.c>
-
-=cut
-
-*/
-
-
-/*
- * Local variables:
- * c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */
Modified: trunk/t/codingstd/c_function_docs.t
==============================================================================
--- trunk/t/codingstd/c_function_docs.t Thu Oct 22 19:38:20 2009 (r42024)
+++ trunk/t/codingstd/c_function_docs.t Thu Oct 22 21:42:07 2009 (r42025)
@@ -129,7 +129,6 @@
src/atomic/gcc_x86.c
src/debug.c
src/gc/generational_ms.c
-src/gc/res_lea.c
src/io/io_string.c
src/nci_test.c
src/pbc_dump.c
More information about the parrot-commits
mailing list