Author: petdance
Date: Thu Jan 31 16:00:49 2008
New Revision: 25394

Modified:
   trunk/src/exec.c
   trunk/src/pmc_freeze.c
   trunk/src/utils.c

Log:
more ajr doc patches, plus a variable localization

Modified: trunk/src/exec.c
==============================================================================
--- trunk/src/exec.c    (original)
+++ trunk/src/exec.c    Thu Jan 31 16:00:49 2008
@@ -260,7 +260,10 @@
 
 =item C<int * Parrot_exec_add_text_rellocation_reg>
 
-RT#48260: Not yet documented!!!
+Adds a register's text rellocation to the object file.  Wrapper
+around C<Parrot_exec_add_text_rellocation>.
+
+Returns pointer to offset. 
 
 =cut
 
@@ -280,7 +283,8 @@
 
 =item C<void Parrot_exec_add_text_rellocation_func>
 
-RT#48260: Not yet documented!!!
+Adds a function's text rellocation to the object file.  Wrapper
+around C<Parrot_exec_add_text_rellocation>.
 
 =cut
 

Modified: trunk/src/pmc_freeze.c
==============================================================================
--- trunk/src/pmc_freeze.c      (original)
+++ trunk/src/pmc_freeze.c      Thu Jan 31 16:00:49 2008
@@ -988,7 +988,8 @@
 
 =item C<static void freeze_pmc>
 
-RT#48260: Not yet documented!!!
+Freeze PMC, setting type, seen, and "same-as-last" indicators as
+appropriate.
 
 =cut
 
@@ -1249,7 +1250,10 @@
 
 =item C<static UINTVAL id_from_pmc>
 
-RT#48260: Not yet documented!!!
+Find a PMC in an arena, and return an id (left-shifted 2 bits),
+based on its position.
+
+If not found, throw an exception.
 
 =cut
 
@@ -1261,12 +1265,11 @@
     UINTVAL id = 1;     /* first PMC in first arena */
     Small_Object_Arena *arena;
     Small_Object_Pool *pool;
-    ptrdiff_t ptr_diff;
 
     pmc = (PMC*)PObj_to_ARENA(pmc);
     pool = interp->arena_base->pmc_pool;
     for (arena = pool->last_Arena; arena; arena = arena->prev) {
-        ptr_diff = (ptrdiff_t)pmc - (ptrdiff_t)arena->start_objects;
+        const ptrdiff_t ptr_diff = (ptrdiff_t)pmc - 
(ptrdiff_t)arena->start_objects;
         if (ptr_diff >= 0 && ptr_diff <
                 (ptrdiff_t)(arena->used * pool->object_size)) {
             PARROT_ASSERT(ptr_diff % pool->object_size == 0);
@@ -1278,7 +1281,7 @@
 
     pool = interp->arena_base->constant_pmc_pool;
     for (arena = pool->last_Arena; arena; arena = arena->prev) {
-        ptr_diff = (ptrdiff_t)pmc - (ptrdiff_t)arena->start_objects;
+        const ptrdiff_t ptr_diff = (ptrdiff_t)pmc - 
(ptrdiff_t)arena->start_objects;
         if (ptr_diff >= 0 && ptr_diff <
                 (ptrdiff_t)(arena->used * pool->object_size)) {
             PARROT_ASSERT(ptr_diff % pool->object_size == 0);

Modified: trunk/src/utils.c
==============================================================================
--- trunk/src/utils.c   (original)
+++ trunk/src/utils.c   Thu Jan 31 16:00:49 2008
@@ -647,9 +647,11 @@
 
 =item C<INTVAL Parrot_byte_index>
 
-RT#48260: Not yet documented!!!
+Looks for the location of a substring within a longer string.  Takes
+pointers to the strings and the offset within the string at which
+to start searching as arguments.
 
-=cut
+Returns an offset value if it is found, or -1 if no match.
 
 */
 
@@ -690,7 +692,10 @@
 
 =item C<INTVAL Parrot_byte_rindex>
 
-RT#48260: Not yet documented!!!
+Substring search (like Parrot_byte_index), but works backwards,
+from the rightmost end of the string.
+
+Returns offset value or -1 (if no match).
 
 =cut
 

Reply via email to