[svn:parrot] r45311 - trunk/src/gc

chromatic at svn.parrot.org chromatic at svn.parrot.org
Tue Mar 30 07:49:11 UTC 2010


Author: chromatic
Date: Tue Mar 30 07:49:10 2010
New Revision: 45311
URL: https://trac.parrot.org/parrot/changeset/45311

Log:
[GC] Made buffer_location() debugging function work with not-so-recent context
changes.

Modified:
   trunk/src/gc/alloc_resources.c

Modified: trunk/src/gc/alloc_resources.c
==============================================================================
--- trunk/src/gc/alloc_resources.c	Tue Mar 30 06:24:59 2010	(r45310)
+++ trunk/src/gc/alloc_resources.c	Tue Mar 30 07:49:10 2010	(r45311)
@@ -53,7 +53,7 @@
 
 PARROT_CANNOT_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
-static const char * buffer_location(PARROT_INTERP, ARGIN(const PObj *b))
+static const char * buffer_location(PARROT_INTERP, ARGIN(const Buffer *b))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
@@ -384,18 +384,17 @@
 PARROT_CANNOT_RETURN_NULL
 PARROT_WARN_UNUSED_RESULT
 static const char *
-buffer_location(PARROT_INTERP, ARGIN(const PObj *b))
+buffer_location(PARROT_INTERP, ARGIN(const Buffer *b))
 {
     ASSERT_ARGS(buffer_location)
-    int i;
+    Parrot_Context * const ctx = CONTEXT(interp);
     static char reg[10];
-
-    Parrot_Context* const ctx = CONTEXT(interp);
+    UINTVAL i;
 
     for (i = 0; i < ctx->n_regs_used[REGNO_STR]; ++i) {
-        PObj * const obj = (PObj *) CTX_REG_STR(interp, ctx, i);
-        if (obj == b) {
-            sprintf(reg, "S%d", i);
+        PObj * const obj = (PObj *)Parrot_pcc_get_STRING_reg(interp, ctx, i);
+        if ((PObj *)obj == b) {
+            sprintf(reg, "S%d", (int)i);
             return reg;
         }
     }


More information about the parrot-commits mailing list