ruby-changes:31568
From: tmm1 <ko1@a...>
Date: Mon, 11 Nov 2013 18:39:23 +0900 (JST)
Subject: [ruby-changes:31568] tmm1:r43647 (trunk): * internal.h: move common string/hash flags to include file.
tmm1 2013-11-11 18:39:13 +0900 (Mon, 11 Nov 2013) New Revision: 43647 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43647 Log: * internal.h: move common string/hash flags to include file. * ext/objspace/objspace_dump.c: remove flags shared above. * hash.c: ditto. * string.c: ditto. Modified files: trunk/ChangeLog trunk/ext/objspace/objspace_dump.c trunk/hash.c trunk/internal.h trunk/string.c Index: ChangeLog =================================================================== --- ChangeLog (revision 43646) +++ ChangeLog (revision 43647) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Mon Nov 11 18:31:12 2013 Aman Gupta <ruby@t...> + + * internal.h: move common string/hash flags to include file. + * ext/objspace/objspace_dump.c: remove flags shared above. + * hash.c: ditto. + * string.c: ditto. + Mon Nov 11 04:36:14 2013 Eric Hodel <drbrain@s...> * lib/rubygems/specification.rb: Include 2.2.0.preview.2 when checking Index: string.c =================================================================== --- string.c (revision 43646) +++ string.c (revision 43647) @@ -49,13 +49,6 @@ VALUE rb_cSymbol; https://github.com/ruby/ruby/blob/trunk/string.c#L49 #define RUBY_MAX_CHAR_LEN 16 #define STR_TMPLOCK FL_USER7 -#define STR_NOEMBED FL_USER1 -#define STR_SHARED FL_USER2 /* = ELTS_SHARED */ -#define STR_ASSOC FL_USER3 -#define STR_SHARED_P(s) FL_ALL((s), STR_NOEMBED|ELTS_SHARED) -#define STR_ASSOC_P(s) FL_ALL((s), STR_NOEMBED|STR_ASSOC) -#define STR_NOCAPA (STR_NOEMBED|ELTS_SHARED|STR_ASSOC) -#define STR_NOCAPA_P(s) (FL_TEST((s),STR_NOEMBED) && FL_ANY((s),ELTS_SHARED|STR_ASSOC)) #define STR_UNSET_NOCAPA(s) do {\ if (FL_TEST((s),STR_NOEMBED)) FL_UNSET((s),(ELTS_SHARED|STR_ASSOC));\ } while (0) @@ -65,7 +58,6 @@ VALUE rb_cSymbol; https://github.com/ruby/ruby/blob/trunk/string.c#L58 STR_SET_EMBED_LEN((str), 0);\ } while (0) #define STR_SET_EMBED(str) FL_UNSET((str), STR_NOEMBED) -#define STR_EMBED_P(str) (!FL_TEST((str), STR_NOEMBED)) #define STR_SET_EMBED_LEN(str, n) do { \ long tmp_n = (n);\ RBASIC(str)->flags &= ~RSTRING_EMBED_LEN_MASK;\ @@ -129,9 +121,6 @@ VALUE rb_cSymbol; https://github.com/ruby/ruby/blob/trunk/string.c#L121 #define STR_HEAP_PTR(str) (RSTRING(str)->as.heap.ptr) #define STR_HEAP_SIZE(str) (RSTRING(str)->as.heap.aux.capa + TERM_LEN(str)) -#define is_ascii_string(str) (rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT) -#define is_broken_string(str) (rb_enc_str_coderange(str) == ENC_CODERANGE_BROKEN) - #define STR_ENC_GET(str) rb_enc_from_index(ENCODING_GET(str)) static int fstring_cmp(VALUE a, VALUE b); Index: ext/objspace/objspace_dump.c =================================================================== --- ext/objspace/objspace_dump.c (revision 43646) +++ ext/objspace/objspace_dump.c (revision 43647) @@ -21,20 +21,6 @@ https://github.com/ruby/ruby/blob/trunk/ext/objspace/objspace_dump.c#L21 #include "vm_core.h" #include "objspace.h" -/* from string.c */ -#define STR_NOEMBED FL_USER1 -#define STR_SHARED FL_USER2 /* = ELTS_SHARED */ -#define STR_ASSOC FL_USER3 -#define STR_SHARED_P(s) FL_ALL((s), STR_NOEMBED|ELTS_SHARED) -#define STR_ASSOC_P(s) FL_ALL((s), STR_NOEMBED|STR_ASSOC) -#define STR_NOCAPA (STR_NOEMBED|ELTS_SHARED|STR_ASSOC) -#define STR_NOCAPA_P(s) (FL_TEST((s),STR_NOEMBED) && FL_ANY((s),ELTS_SHARED|STR_ASSOC)) -#define STR_EMBED_P(str) (!FL_TEST((str), STR_NOEMBED)) -#define is_ascii_string(str) (rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT) -#define is_broken_string(str) (rb_enc_str_coderange(str) == ENC_CODERANGE_BROKEN) -/* from hash.c */ -#define HASH_PROC_DEFAULT FL_USER2 - static VALUE sym_output, sym_stdout, sym_string, sym_file; struct dump_config { Index: hash.c =================================================================== --- hash.c (revision 43646) +++ hash.c (revision 43647) @@ -29,9 +29,6 @@ https://github.com/ruby/ruby/blob/trunk/hash.c#L29 static VALUE rb_hash_s_try_convert(VALUE, VALUE); -#define HASH_DELETED FL_USER1 -#define HASH_PROC_DEFAULT FL_USER2 - /* * Hash WB strategy: * 1. Check mutate st_* functions Index: internal.h =================================================================== --- internal.h (revision 43646) +++ internal.h (revision 43647) @@ -439,6 +439,8 @@ struct st_table *rb_hash_tbl_raw(VALUE h https://github.com/ruby/ruby/blob/trunk/internal.h#L439 #define RHASH_TBL_RAW(h) rb_hash_tbl_raw(h) VALUE rb_hash_keys(VALUE hash); VALUE rb_hash_values(VALUE hash); +#define HASH_DELETED FL_USER1 +#define HASH_PROC_DEFAULT FL_USER2 /* inits.c */ void rb_call_inits(void); @@ -675,6 +677,16 @@ VALUE rb_str_locktmp_ensure(VALUE str, V https://github.com/ruby/ruby/blob/trunk/internal.h#L677 #ifdef RUBY_ENCODING_H VALUE rb_external_str_with_enc(VALUE str, rb_encoding *eenc); #endif +#define STR_NOEMBED FL_USER1 +#define STR_SHARED FL_USER2 /* = ELTS_SHARED */ +#define STR_ASSOC FL_USER3 +#define STR_SHARED_P(s) FL_ALL((s), STR_NOEMBED|ELTS_SHARED) +#define STR_ASSOC_P(s) FL_ALL((s), STR_NOEMBED|STR_ASSOC) +#define STR_NOCAPA (STR_NOEMBED|ELTS_SHARED|STR_ASSOC) +#define STR_NOCAPA_P(s) (FL_TEST((s),STR_NOEMBED) && FL_ANY((s),ELTS_SHARED|STR_ASSOC)) +#define STR_EMBED_P(str) (!FL_TEST((str), STR_NOEMBED)) +#define is_ascii_string(str) (rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT) +#define is_broken_string(str) (rb_enc_str_coderange(str) == ENC_CODERANGE_BROKEN) /* struct.c */ VALUE rb_struct_init_copy(VALUE copy, VALUE s); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/