ruby-changes:49689
From: mame <ko1@a...>
Date: Sat, 13 Jan 2018 21:17:47 +0900 (JST)
Subject: [ruby-changes:49689] mame:r61806 (trunk): variable.c (struct gen_ivtbl): Use FLEX_ARY_LEN.
mame 2018-01-13 21:17:42 +0900 (Sat, 13 Jan 2018) New Revision: 61806 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61806 Log: variable.c (struct gen_ivtbl): Use FLEX_ARY_LEN. Modified files: trunk/variable.c Index: variable.c =================================================================== --- variable.c (revision 61805) +++ variable.c (revision 61806) @@ -34,7 +34,7 @@ static st_table *generic_iv_tbl_compat; https://github.com/ruby/ruby/blob/trunk/variable.c#L34 /* per-object */ struct gen_ivtbl { uint32_t numiv; - VALUE ivptr[1]; /* flexible array */ + VALUE ivptr[FLEX_ARY_LEN]; }; struct ivar_update { @@ -1001,7 +1001,7 @@ generic_ivar_get(VALUE obj, ID id, VALUE https://github.com/ruby/ruby/blob/trunk/variable.c#L1001 static size_t gen_ivtbl_bytes(size_t n) { - return sizeof(struct gen_ivtbl) + n * sizeof(VALUE) - sizeof(VALUE); + return sizeof(struct gen_ivtbl) + n * sizeof(VALUE); } static struct gen_ivtbl * -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/