]> granicus.if.org Git - gc/commit
Fix GET_MEM argument rounding in GC_scratch_alloc and similar
authorIvan Maidanski <ivmai@mail.ru>
Sun, 30 Mar 2014 08:31:49 +0000 (12:31 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 2 May 2014 20:31:53 +0000 (00:31 +0400)
commit62bfeb0d34a13ee1bea27a5836ec87e703ab5f3d
tree6766205410155c462f210edb9b2cfd04b745ac9b
parent64ad6f0341cb9c6896e666ad5df74148e1cfd988
Fix GET_MEM argument rounding in GC_scratch_alloc and similar
(Prevent abort in GC_unix_mmap_get_mem if the allocation size is not
a multiple of a page size.)
(Apply commit 180b56c from 'master' branch.)

* backgraph.c (new_back_edges, push_in_progress): Use
ROUNDUP_PAGESIZE_IF_MMAP() to adjust GET_MEM() argument (when needed).
* headers.c (GC_scratch_alloc): Likewise.
* misc.c (GC_envfile_init): Likewise.
* include/private/gc_priv.h (ROUNDUP_PAGESIZE_IF_MMAP): New macro.
* include/private/gcconfig.h (MMAP_SUPPORTED): Move definition from
os_dep.c (as needed for ROUNDUP_PAGESIZE_IF_MMAP() definition).
* include/private/gcconfig.h (GET_MEM): Refine comment (regarding its
argument).

Conflicts:

    headers.c
    include/private/gc_priv.h
backgraph.c
headers.c
include/private/gc_priv.h
include/private/gcconfig.h
misc.c
os_dep.c