summaryrefslogtreecommitdiff
path: root/iseq.h
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 /iseq.h
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 'iseq.h')
-rw-r--r--iseq.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/iseq.h b/iseq.h
index 9a225180df..da2b678c1b 100644
--- a/iseq.h
+++ b/iseq.h
@@ -88,11 +88,15 @@ iseq_catch_table_bytes(int n)
struct iseq_compile_data_storage {
struct iseq_compile_data_storage *next;
- unsigned long pos;
- unsigned long size;
- char *buff;
+ unsigned int pos;
+ unsigned int size;
+ char buff[1]; /* flexible array */
};
+/* account for flexible array */
+#define SIZEOF_ISEQ_COMPILE_DATA_STORAGE \
+ (sizeof(struct iseq_compile_data_storage) - 1)
+
struct iseq_compile_data {
/* GC is needed */
const VALUE err_info;