mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e22d8781c8
commit
8f3934261a
5 changed files with 19 additions and 28 deletions
|
@ -1,3 +1,10 @@
|
|||
Mon Nov 11 18:31:12 2013 Aman Gupta <ruby@tmm1.net>
|
||||
|
||||
* 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@segment7.net>
|
||||
|
||||
* lib/rubygems/specification.rb: Include 2.2.0.preview.2 when checking
|
||||
|
|
|
@ -21,20 +21,6 @@
|
|||
#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 {
|
||||
|
|
3
hash.c
3
hash.c
|
@ -29,9 +29,6 @@
|
|||
|
||||
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
|
||||
|
|
12
internal.h
12
internal.h
|
@ -439,6 +439,8 @@ struct st_table *rb_hash_tbl_raw(VALUE hash);
|
|||
#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, VALUE (*func)(VALUE), VALUE arg);
|
|||
#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);
|
||||
|
|
11
string.c
11
string.c
|
@ -49,13 +49,6 @@ VALUE rb_cSymbol;
|
|||
|
||||
#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;
|
|||
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;
|
|||
#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);
|
||||
|
|
Loading…
Reference in a new issue