]> granicus.if.org Git - gc/commit
Speedup calloc size overflow check by preventing division if small values
authorHans Boehm <Hans.Boehm@hp.com>
Thu, 15 Mar 2012 17:09:05 +0000 (21:09 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 15 Mar 2012 17:09:05 +0000 (21:09 +0400)
commit83231d0ab5ed60015797c3d1ad9056295ac3b2bb
tree7038b9ba4c272b4f87d65068aaae8e3012fc3d22
parent6a93f8e5bcad22137f41b6c60a1c7384baaec2b3
Speedup calloc size overflow check by preventing division if small values

* malloc.c (GC_SQRT_SIZE_MAX): New macro.
* malloc.c (calloc): Add fast initial size overflow check to avoid
integer division for reasonably small values passed.
malloc.c