[svn:parrot] r40315 - in trunk: include/parrot src/string

NotFound at svn.parrot.org NotFound at svn.parrot.org
Tue Jul 28 21:12:35 UTC 2009


Author: NotFound
Date: Tue Jul 28 21:12:35 2009
New Revision: 40315
URL: https://trac.parrot.org/parrot/changeset/40315

Log:
[cage] remove obsolete function str_dup

Modified:
   trunk/include/parrot/string_primitives.h
   trunk/src/string/primitives.c

Modified: trunk/include/parrot/string_primitives.h
==============================================================================
--- trunk/include/parrot/string_primitives.h	Tue Jul 28 20:51:14 2009	(r40314)
+++ trunk/include/parrot/string_primitives.h	Tue Jul 28 21:12:35 2009	(r40315)
@@ -25,12 +25,6 @@
 PARROT_EXPORT
 PARROT_MALLOC
 PARROT_CANNOT_RETURN_NULL
-char * str_dup(ARGIN(const char *old))
-        __attribute__nonnull__(1);
-
-PARROT_EXPORT
-PARROT_MALLOC
-PARROT_CANNOT_RETURN_NULL
 char * str_dup_remove_quotes(ARGIN(const char *old))
         __attribute__nonnull__(1);
 
@@ -50,8 +44,6 @@
         FUNC_MODIFIES(*string);
 
 #define ASSERT_ARGS_Parrot_char_digit_value __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_str_dup __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(old)
 #define ASSERT_ARGS_str_dup_remove_quotes __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(old)
 #define ASSERT_ARGS_string_set_data_directory __attribute__unused__ int _ASSERT_ARGS_CHECK = \

Modified: trunk/src/string/primitives.c
==============================================================================
--- trunk/src/string/primitives.c	Tue Jul 28 20:51:14 2009	(r40314)
+++ trunk/src/string/primitives.c	Tue Jul 28 21:12:35 2009	(r40315)
@@ -337,33 +337,6 @@
 
 /*
 
-=item C<char * str_dup(const char *old)>
-
-Duplicate a C string.  Just like strdup(), except it dies if it runs
-out of memory.
-
-=cut
-
-*/
-
-PARROT_EXPORT
-PARROT_MALLOC
-PARROT_CANNOT_RETURN_NULL
-char *
-str_dup(ARGIN(const char *old))
-{
-    ASSERT_ARGS(str_dup)
-    const size_t bytes = strlen(old) + 1;
-    char * const copy = (char *)mem_sys_allocate(bytes);
-    memcpy(copy, old, bytes);
-#ifdef MEMDEBUG
-    debug(interp, 1, "line %d str_dup %s [%x]\n", line, old, copy);
-#endif
-    return copy;
-}
-
-/*
-
 =item C<char * str_dup_remove_quotes(const char *old)>
 
 Duplicates a C string (minus the wrapping quotes).  Similar to strdup(),


More information about the parrot-commits mailing list