Fix GC_collect_or_expand to prevent allocation size value wrap-around
authorIvan Maidanski <ivmai@mail.ru>
Tue, 27 Sep 2016 07:12:18 +0000 (10:12 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 27 Sep 2016 07:14:50 +0000 (10:14 +0300)
commit552ad0834672fed86ada6430150ef9ebdd3f54d7
tree183c2beddc87d2e0f8205f7b43aba2e31ff20dae
parent7292c02fac2066d39dd1bcc37d1a7054fd1e32ee
Fix GC_collect_or_expand to prevent allocation size value wrap-around

Relates to issue #135 on Github.

* alloc.c (GC_WORD_MAX): New macro.
* alloc.c (GC_collect_or_expand): Limit blocks_to_get by
GC_WORD_MAX / HBLKSIZE value (to avoid multiplication overflow in
GC_expand_hp_inner).
alloc.c