summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-26 07:57:44 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-26 07:57:44 +0000
commit36b476cd1e24f0f0b472d86cdf422f5e2085b7f5 (patch)
tree83ea5b995bc9fdc882654d012ba3d9f347d45c69 /compile.c
parenta9c7629ece428e1de9119137a1b3f2e899b9d9e7 (diff)
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 'compile.c')
-rw-r--r--compile.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/compile.c b/compile.c
index 7dfaa81f47..f9bd9a531e 100644
--- a/compile.c
+++ b/compile.c
@@ -604,13 +604,11 @@ compile_data_alloc(rb_iseq_t *iseq, size_t size)
goto retry;
}
storage->next = (void *)ALLOC_N(char, alloc_size +
- sizeof(struct
- iseq_compile_data_storage));
+ SIZEOF_ISEQ_COMPILE_DATA_STORAGE);
storage = iseq->compile_data->storage_current = storage->next;
storage->next = 0;
storage->pos = 0;
storage->size = alloc_size;
- storage->buff = (char *)(&storage->buff + 1);
}
ptr = (void *)&storage->buff[storage->pos];