зеркало из https://github.com/github/ruby.git
symbol.c: move macros
* symbol.c (SYMBOL_PINNED, SYMBOL_PINNED_P, ID_DYNAMIC_SYM_P), (STATIC_SYM2ID, STATIC_ID2SYM): move from symbol.h as these macros are used only in symbol.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
0e6a399185
Коммит
0ee5c55e51
7
symbol.c
7
symbol.c
|
@ -18,6 +18,13 @@
|
|||
#include "gc.h"
|
||||
#include "probes.h"
|
||||
|
||||
#define SYMBOL_PINNED FL_USER1
|
||||
#define SYMBOL_PINNED_P(sym) FL_TEST((sym), SYMBOL_PINNED)
|
||||
|
||||
#define ID_DYNAMIC_SYM_P(id) (!(id&ID_STATIC_SYM)&&id>tLAST_OP_ID)
|
||||
#define STATIC_SYM2ID(sym) RSHIFT((unsigned long)(sym), RUBY_SPECIAL_SHIFT)
|
||||
#define STATIC_ID2SYM(id) (((VALUE)(id)<<RUBY_SPECIAL_SHIFT)|SYMBOL_FLAG)
|
||||
|
||||
static ID register_static_symid(ID, const char *, long, rb_encoding *);
|
||||
static ID register_static_symid_str(ID, VALUE);
|
||||
#define REGISTER_SYMID(id, name) register_static_symid((id), (name), strlen(name), enc)
|
||||
|
|
6
symbol.h
6
symbol.h
|
@ -15,12 +15,6 @@
|
|||
#include "id.h"
|
||||
|
||||
#define RSYMBOL(obj) (R_CAST(RSymbol)(obj))
|
||||
#define SYMBOL_PINNED FL_USER1
|
||||
#define SYMBOL_PINNED_P(sym) FL_TEST((sym), SYMBOL_PINNED)
|
||||
|
||||
#define ID_DYNAMIC_SYM_P(id) (!(id&ID_STATIC_SYM)&&id>tLAST_OP_ID)
|
||||
#define STATIC_SYM2ID(sym) RSHIFT((unsigned long)(sym), RUBY_SPECIAL_SHIFT)
|
||||
#define STATIC_ID2SYM(id) (((VALUE)(id)<<RUBY_SPECIAL_SHIFT)|SYMBOL_FLAG)
|
||||
|
||||
static inline int
|
||||
id_type(ID id)
|
||||
|
|
Загрузка…
Ссылка в новой задаче