[SectionMemoryManager] Make better use of virtual memory
authorKeno Fischer <kfischer@college.harvard.edu>
Wed, 16 Dec 2015 11:13:23 +0000 (11:13 +0000)
committerKeno Fischer <kfischer@college.harvard.edu>
Wed, 16 Dec 2015 11:13:23 +0000 (11:13 +0000)
commitf04cdf9dd9078a3c10cb1d821e929183235e06a7
treec4fe90e34b60ec8074cbf769c6508240681bf1c9
parentb1415e7ebadc135ddad990a19d30aed8757587da
[SectionMemoryManager] Make better use of virtual memory

Summary: On Windows, the allocation granularity can be significantly
larger than a page (64K), so with many small objects, just clearing
the FreeMem list rapidly leaks quite a bit of virtual memory space
(if not rss). Fix that by only removing those parts of the FreeMem
blocks that overlap pages for which we are applying memory permissions,
rather than dropping the FreeMem blocks entirely.

Reviewers: lhames

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D15202

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255760 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ExecutionEngine/SectionMemoryManager.h
lib/ExecutionEngine/SectionMemoryManager.cpp
lib/Support/Unix/Memory.inc