mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
7da7716159
commit
2768bae806
1 changed files with 2 additions and 2 deletions
4
node.c
4
node.c
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue