[svn:parrot] r40935 - in trunk: docs docs/pdds include/parrot src/gc src/runcore
chromatic at svn.parrot.org
chromatic at svn.parrot.org
Thu Sep 3 00:10:55 UTC 2009
Author: chromatic
Date: Thu Sep 3 00:10:54 2009
New Revision: 40935
URL: https://trac.parrot.org/parrot/changeset/40935
Log:
[docs] Updated documentation to reflect PObj layout changes. Patch by
jrtayloriv in TT #958.
Modified:
trunk/docs/memory_internals.pod
trunk/docs/pdds/pdd09_gc.pod
trunk/docs/pdds/pdd28_strings.pod
trunk/include/parrot/pobj.h
trunk/src/gc/api.c
trunk/src/runcore/cores.c
Modified: trunk/docs/memory_internals.pod
==============================================================================
--- trunk/docs/memory_internals.pod Thu Sep 3 00:10:47 2009 (r40934)
+++ trunk/docs/memory_internals.pod Thu Sep 3 00:10:54 2009 (r40935)
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2004, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
# $Id$
=head1 NAME
@@ -117,18 +117,16 @@
=head2 General structure of a buffer-like item
struct parrot_object_t {
- UnionVal cache;
unsigned flags;
...
} PObj;
-This does not totally reflect the current implementation, but is the spirit of
-the abstraction of current objects. The C<UnionVal cache> field is a C<union>
-that contains a variety of pointer and data configurations. The flags field
-may contain a series of flags which indicate the type, status, configuration,
-and special requirements of each item. Buffers, C<PMC>s, and C<PObj>s all
-have these basic fields in common, although they also contain a variety of
-other data fields, depending on type.
+The flags field may contain a series of flags which indicate the type, status,
+configuration, and special requirements of each item. C<Buffer>s, C<PMC>s, and
+C<PObj>s all have this basic field in common.
+
+C<PMC>s and C<Buffer>s each have an additional field which contain a pointer
+to a block of data.
=head2 GC-related PObj flags
@@ -279,5 +277,3 @@
=head1 VERSION
0.1.1 June 2008
-
-
Modified: trunk/docs/pdds/pdd09_gc.pod
==============================================================================
--- trunk/docs/pdds/pdd09_gc.pod Thu Sep 3 00:10:47 2009 (r40934)
+++ trunk/docs/pdds/pdd09_gc.pod Thu Sep 3 00:10:54 2009 (r40935)
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2009, Parrot Foundation.
# $Id$
=head1 PDD 9: Garbage Collection Subsystem
@@ -620,6 +620,9 @@
=head2 References
+"Uniprocessor Garbage Collection Techniques"
+http://www.cs.rice.edu/~javaplt/311/Readings/wilson92uniprocessor.pdf
+
"A unified theory of garbage collection":
http://portal.acm.org/citation.cfm?id=1028982
Modified: trunk/docs/pdds/pdd28_strings.pod
==============================================================================
--- trunk/docs/pdds/pdd28_strings.pod Thu Sep 3 00:10:47 2009 (r40934)
+++ trunk/docs/pdds/pdd28_strings.pod Thu Sep 3 00:10:54 2009 (r40935)
@@ -257,30 +257,29 @@
Parrot's internal strings (C<STRING>s) have the following structure:
- struct parrot_string_t {
- UnionVal cache;
- Parrot_UInt flags;
- UINTVAL bufused;
- UINTVAL strlen;
- UINTVAL hashval;
- const struct _encoding *encoding;
- const struct _charset *charset;
- const struct _normalization *normalization;
- };
+ struct parrot_string_t {
+ Parrot_UInt flags;
+ void * _bufstart;
+ size_t _buflen;
+ char *strstart;
+ UINTVAL bufused;
+ UINTVAL strlen;
+ UINTVAL hashval;
+ const struct _encoding *encoding;
+ const struct _charset *charset;
+};
The fields are:
=over 4
-=item cache
+=item _bufstart
-A structure that holds the buffer for the string data and the size of the
-buffer in bytes.
+A pointer to the buffer for the string data.
-{{ NOTE: this is currently called "cache" for compatibility with PMC
-structures. As we eliminate the cache from PMCs, we will flatten out this
-union value in the string structure to two members: a string buffer and the
-size of the buffer used. }}
+=item _buflen
+
+The size of the buffer in bytes.
=item flags
@@ -320,13 +319,6 @@
The charset structure specifies the character set (by index number and by
name) and provides functions for transcoding to and from that character set.
-=item normalization
-
-What normalization form the string data is in, one of the four Unicode
-normalization forms or NFG. This structure stores the current normalization
-form, function pointers for composition and decomposition for the current
-normalization form, and a pointer to the grapheme table for NFG.
-
=back
{{DEPRECATION NOTE: the enum C<parrot_string_representation_t> will be removed
Modified: trunk/include/parrot/pobj.h
==============================================================================
--- trunk/include/parrot/pobj.h Thu Sep 3 00:10:47 2009 (r40934)
+++ trunk/include/parrot/pobj.h Thu Sep 3 00:10:54 2009 (r40935)
@@ -38,9 +38,8 @@
v v
The actual set-up is more involved because of padding. obj->bufstart must
-be suitably aligned for any UnionVal. (Perhaps it should be a Buffer
-there instead.) The start of the memory region (as returned by malloc()
-is also suitably aligned for any use. If, for example, malloc() returns
+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.
Modified: trunk/src/gc/api.c
==============================================================================
--- trunk/src/gc/api.c Thu Sep 3 00:10:47 2009 (r40934)
+++ trunk/src/gc/api.c Thu Sep 3 00:10:54 2009 (r40935)
@@ -1682,7 +1682,7 @@
=head1 SEE ALSO
-F<include/parrot/gc_api.h>, F<src/cpu_dep.c> and F<docs/pdds/pdd09_gc.pod>.
+F<include/parrot/gc_api.h>, F<src/gc/system.c> and F<docs/pdds/pdd09_gc.pod>.
=head1 HISTORY
Modified: trunk/src/runcore/cores.c
==============================================================================
--- trunk/src/runcore/cores.c Thu Sep 3 00:10:47 2009 (r40934)
+++ trunk/src/runcore/cores.c Thu Sep 3 00:10:54 2009 (r40935)
@@ -382,7 +382,7 @@
PARROT_ASSERT(debugger);
/* set the top of the stack so GC can trace it for GC-able pointers
- * see trace_system_areas() in src/cpu_dep.c */
+ * see trace_system_areas() in src/gc/system.c */
debugger->lo_var_ptr = interp->lo_var_ptr;
pio = Parrot_io_STDERR(debugger);
More information about the parrot-commits
mailing list