[svn:parrot] r43902 - in trunk: include/parrot src/gc src/interp

bacek at svn.parrot.org bacek at svn.parrot.org
Thu Feb 11 13:36:08 UTC 2010


Author: bacek
Date: Thu Feb 11 13:36:07 2010
New Revision: 43902
URL: https://trac.parrot.org/parrot/changeset/43902

Log:
Fix gc_sys_name

Modified:
   trunk/include/parrot/gc_api.h
   trunk/src/gc/api.c
   trunk/src/interp/inter_misc.c

Modified: trunk/include/parrot/gc_api.h
==============================================================================
--- trunk/include/parrot/gc_api.h	Thu Feb 11 13:33:03 2010	(r43901)
+++ trunk/include/parrot/gc_api.h	Thu Feb 11 13:36:07 2010	(r43902)
@@ -285,6 +285,10 @@
         __attribute__nonnull__(2)
         FUNC_MODIFIES(*str);
 
+PARROT_CANNOT_RETURN_NULL
+STRING * Parrot_gc_sys_name(PARROT_INTERP)
+        __attribute__nonnull__(1);
+
 UINTVAL Parrot_gc_total_copied(PARROT_INTERP)
         __attribute__nonnull__(1);
 
@@ -409,6 +413,8 @@
      __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(str))
+#define ASSERT_ARGS_Parrot_gc_sys_name __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_Parrot_gc_total_copied __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_Parrot_gc_total_memory_allocated \

Modified: trunk/src/gc/api.c
==============================================================================
--- trunk/src/gc/api.c	Thu Feb 11 13:33:03 2010	(r43901)
+++ trunk/src/gc/api.c	Thu Feb 11 13:36:07 2010	(r43902)
@@ -995,6 +995,7 @@
 
 */
 
+PARROT_CANNOT_RETURN_NULL
 STRING *
 Parrot_gc_sys_name(PARROT_INTERP) {
     switch (interp->gc_sys->sys_type) {

Modified: trunk/src/interp/inter_misc.c
==============================================================================
--- trunk/src/interp/inter_misc.c	Thu Feb 11 13:33:03 2010	(r43901)
+++ trunk/src/interp/inter_misc.c	Thu Feb 11 13:36:07 2010	(r43902)
@@ -359,11 +359,8 @@
         }
         case RUNTIME_PREFIX:
             return Parrot_get_runtime_path(interp);
-        case GC_SYS_NAME: {
-            const char * const name = Parrot_gc_sys_name(interp);
-            STRING *const newstr = Parrot_str_new(interp, name, strlen(name));
-            return name;
-        }
+        case GC_SYS_NAME:
+            return Parrot_gc_sys_name(interp);
       default:
         Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
                 "illegal argument in interpinfo");


More information about the parrot-commits mailing list