diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-13 12:09:24 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-13 12:09:24 +0000 |
commit | 2768bae806cd502a76d02b76b09f546296a10aa8 (patch) | |
tree | a46ac58ffffbc528c66b55b80a789e3e19cc7f4b /node.c | |
parent | 7da7716159f296e0175aad3a23452ef9710e80e5 (diff) |
node.c (node_buffer_elem_t): Use FLEX_ARY_LEN
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'node.c')
-rw-r--r-- | node.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1034,7 +1034,7 @@ rb_node_init(NODE *n, enum node_type type, VALUE a0, VALUE a1, VALUE a2) typedef struct node_buffer_elem_struct { struct node_buffer_elem_struct *next; - NODE buf[1]; /* flexible array */ + NODE buf[FLEX_ARY_LEN]; } node_buffer_elem_t; struct node_buffer_struct { @@ -1046,7 +1046,7 @@ struct node_buffer_struct { static node_buffer_t * rb_node_buffer_new(void) { - node_buffer_t *nb = xmalloc(offsetof(node_buffer_t, body) + offsetof(node_buffer_elem_t, buf) + 16 * sizeof(NODE)); + node_buffer_t *nb = xmalloc(sizeof(node_buffer_t) + 16 * sizeof(NODE)); nb->idx = 0; nb->len = 16; nb->head = &nb->body; |