Rename new_stack_string to init_stack_string This function doesn't allocate memory.
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/f0970936 Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/f0970936 Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/f0970936 Branch: refs/heads/master Commit: f09709361e96ee018a2851f43b982c3323e0b656 Parents: e0d8301 Author: Nick Wellnhofer <[email protected]> Authored: Thu Oct 22 15:27:30 2015 +0200 Committer: Nick Wellnhofer <[email protected]> Committed: Wed Oct 28 14:59:51 2015 +0100 ---------------------------------------------------------------------- runtime/core/Clownfish/String.c | 2 +- runtime/core/Clownfish/String.cfh | 6 +++--- runtime/perl/xs/XSBind.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/f0970936/runtime/core/Clownfish/String.c ---------------------------------------------------------------------- diff --git a/runtime/core/Clownfish/String.c b/runtime/core/Clownfish/String.c index a1ac875..3124be5 100644 --- a/runtime/core/Clownfish/String.c +++ b/runtime/core/Clownfish/String.c @@ -118,7 +118,7 @@ Str_new_wrap_trusted_utf8(const char *utf8, size_t size) { } String* -Str_new_stack_string(void *allocation, const char *utf8, size_t size) { +Str_init_stack_string(void *allocation, const char *utf8, size_t size) { String *self = (String*)Class_Init_Obj(STRING, allocation); return Str_init_wrap_trusted_utf8(self, utf8, size); } http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/f0970936/runtime/core/Clownfish/String.cfh ---------------------------------------------------------------------- diff --git a/runtime/core/Clownfish/String.cfh b/runtime/core/Clownfish/String.cfh index b49a0df..98b341f 100644 --- a/runtime/core/Clownfish/String.cfh +++ b/runtime/core/Clownfish/String.cfh @@ -85,7 +85,7 @@ public final class Clownfish::String nickname Str new_wrap_trusted_utf8(const char *utf8, size_t size); inert incremented String* - new_stack_string(void *allocation, const char *utf8, size_t size); + init_stack_string(void *allocation, const char *utf8, size_t size); /** Initialize a String which wraps an external buffer containing UTF-8 * character data after checking for validity. @@ -390,10 +390,10 @@ public final class Clownfish::StringIterator nickname StrIter __C__ #define CFISH_SSTR_BLANK() \ - cfish_Str_new_stack_string(CFISH_ALLOCA_OBJ(CFISH_STRING), "", 0) + cfish_Str_init_stack_string(CFISH_ALLOCA_OBJ(CFISH_STRING), "", 0) #define CFISH_SSTR_WRAP_UTF8(ptr, size) \ - cfish_Str_new_stack_string(CFISH_ALLOCA_OBJ(CFISH_STRING), ptr, size) + cfish_Str_init_stack_string(CFISH_ALLOCA_OBJ(CFISH_STRING), ptr, size) #define CFISH_STRITER_DONE -1 http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/f0970936/runtime/perl/xs/XSBind.c ---------------------------------------------------------------------- diff --git a/runtime/perl/xs/XSBind.c b/runtime/perl/xs/XSBind.c index 39f4c5a..a261152 100644 --- a/runtime/perl/xs/XSBind.c +++ b/runtime/perl/xs/XSBind.c @@ -200,7 +200,7 @@ S_maybe_perl_to_cfish(pTHX_ SV *sv, cfish_Class *klass, bool increment, if (!allocation) { CFISH_THROW(CFISH_ERR, "Allocation for stack string missing"); } - *obj_ptr = (cfish_Obj*)cfish_Str_new_stack_string( + *obj_ptr = (cfish_Obj*)cfish_Str_init_stack_string( allocation, ptr, size); return true; }
