summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorLourens Naudé <lourens@bearmetal.eu>2019-07-03 00:29:33 +0100
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-07-08 13:30:21 +0900
commit612cad5d202cec168bcbfec0f148a577dbd98e8d (patch)
tree3a5b3252bde46ec79e41860b6f08ca36b7ebf89d /ext
parente9907122ed6d71de4601b0be22e39e4486636c69 (diff)
Let struct dump_config in objspace fit in a single cache line
Let dump_config boolean members roots and full_heap be bit flags instead Closes: https://github.com/ruby/ruby/pull/2274
Diffstat (limited to 'ext')
-rw-r--r--ext/objspace/objspace_dump.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/objspace/objspace_dump.c b/ext/objspace/objspace_dump.c
index 602cbadef5..7dcee589bf 100644
--- a/ext/objspace/objspace_dump.c
+++ b/ext/objspace/objspace_dump.c
@@ -27,12 +27,12 @@ struct dump_config {
VALUE type;
FILE *stream;
VALUE string;
- int roots;
const char *root_category;
VALUE cur_obj;
VALUE cur_obj_klass;
size_t cur_obj_references;
- int full_heap;
+ unsigned int roots: 1;
+ unsigned int full_heap: 1;
};
PRINTF_ARGS(static void dump_append(struct dump_config *, const char *, ...), 2, 3);
@@ -368,7 +368,7 @@ root_obj_i(const char *category, VALUE obj, void *data)
dump_append(dc, ", \"%#"PRIxVALUE"\"", obj);
dc->root_category = category;
- dc->roots++;
+ dc->roots = 1;
}
static VALUE