diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-26 07:57:44 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-26 07:57:44 +0000 |
commit | 36b476cd1e24f0f0b472d86cdf422f5e2085b7f5 (patch) | |
tree | 83ea5b995bc9fdc882654d012ba3d9f347d45c69 /iseq.c | |
parent | a9c7629ece428e1de9119137a1b3f2e899b9d9e7 (diff) | |
download | ruby-36b476cd1e24f0f0b472d86cdf422f5e2085b7f5.tar.gz |
struct iseq_compile_data_storage: 16 bytes (from 32) overhead
This reduces the iseq_compile_data_storage header from 32 to 16
bytes on 64-bit systems.
pos and size fields cannot exceed 32-bit sizes due to stack size
limits. Using a flexible array for the buffer also saves us 8
bytes of pointer overhead.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r-- | iseq.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -153,7 +153,7 @@ iseq_memsize(const void *ptr) cur = iseq->compile_data->storage_head; while (cur) { - size += cur->size + sizeof(struct iseq_compile_data_storage); + size += cur->size + SIZEOF_ISEQ_COMPILE_DATA_STORAGE; cur = cur->next; } size += sizeof(struct iseq_compile_data); @@ -293,15 +293,13 @@ prepare_iseq_build(rb_iseq_t *iseq, iseq->compile_data->storage_head = iseq->compile_data->storage_current = (struct iseq_compile_data_storage *) ALLOC_N(char, INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE + - sizeof(struct iseq_compile_data_storage)); + SIZEOF_ISEQ_COMPILE_DATA_STORAGE); RB_OBJ_WRITE(iseq->self, &iseq->compile_data->catch_table_ary, rb_ary_new()); iseq->compile_data->storage_head->pos = 0; iseq->compile_data->storage_head->next = 0; iseq->compile_data->storage_head->size = INITIAL_ISEQ_COMPILE_DATA_STORAGE_BUFF_SIZE; - iseq->compile_data->storage_head->buff = - (char *)(&iseq->compile_data->storage_head->buff + 1); iseq->compile_data->option = option; iseq->compile_data->last_coverable_line = -1; |