1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
Lourens Naudé 2019-07-03 00:29:33 +01:00 committed by Nobuyoshi Nakada
parent e9907122ed
commit 612cad5d20
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -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