]> git.proxmox.com Git - mirror_qemu.git/commit - util/oslib-posix.c
oslib: rework anonimous RAM allocation
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 10 Sep 2015 13:36:51 +0000 (16:36 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 1 Oct 2015 13:16:52 +0000 (16:16 +0300)
commitc2dfc5ba3fb3a1b7278c99bfd3bf350202169434
tree2f8db5fe1a3ed277d719eb8f354cbfb46a4586e2
parent0cf33fb6b49a19de32859e2cdc6021334f448fb3
oslib: rework anonimous RAM allocation

At the moment we first allocate RAM, sometimes more than necessary for
alignment reasons.  We then free the extra RAM.

Rework this to avoid the temporary allocation: reserve the
range by mapping it with PROT_NONE, then use just the
necessary range with MAP_FIXED.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
util/oslib-posix.c