diff options
author | Koichi Sasada <ko1@atdot.net> | 2020-07-03 16:56:44 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-03 16:56:44 +0900 |
commit | a0f12a0258e4020bd657ee80b7d8f22bd33ea223 (patch) | |
tree | f6ebafa85cba2bddddc090f8d3c3b74c2c9f374b /node.c | |
parent | 8655c2e69041cc812d30c2e951a8ac9ea7a60c47 (diff) |
Use ID instead of GENTRY for gvars. (#3278)
Use ID instead of GENTRY for gvars.
Global variables are compiled into GENTRY (a pointer to struct
rb_global_entry). This patch replace this GENTRY to ID and
make the code simple.
We need to search GENTRY from ID every time (st_lookup), so
additional overhead will be introduced.
However, the performance of accessing global variables is not
important now a day and this simplicity helps Ractor development.
Notes
Notes:
Merged-By: ko1 <ko1@atdot.net>
Diffstat (limited to 'node.c')
-rw-r--r-- | node.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -63,7 +63,7 @@ #define SIMPLE_FIELD1(name, ann) SIMPLE_FIELD(FIELD_NAME_LEN(name, ann), FIELD_NAME_DESC(name, ann)) #define F_CUSTOM1(name, ann) SIMPLE_FIELD1(#name, ann) #define F_ID(name, ann) SIMPLE_FIELD1(#name, ann) A_ID(node->name) -#define F_GENTRY(name, ann) SIMPLE_FIELD1(#name, ann) A_ID((node->name)->id) +#define F_GENTRY(name, ann) SIMPLE_FIELD1(#name, ann) A_ID(node->name) #define F_INT(name, ann) SIMPLE_FIELD1(#name, ann) A_INT(node->name) #define F_LONG(name, ann) SIMPLE_FIELD1(#name, ann) A_LONG(node->name) #define F_LIT(name, ann) SIMPLE_FIELD1(#name, ann) A_LIT(node->name) |