diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-03-23 19:57:22 +0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-04-06 10:50:38 +0200 |
commit | 8e3b0cbb7212a1e5707ed2d4c26b4e3d2483768d (patch) | |
tree | fe73195ef7adcea2745f6f31502264157be476c2 /softmmu/physmem.c | |
parent | b307e5052d5c09a2bb71b1670c14ca4fc44ea33f (diff) |
Replace qemu_real_host_page variables with inlined functions
Replace the global variables with inlined helper functions. getpagesize() is very
likely annotated with a "const" function attribute (at least with glibc), and thus
optimization should apply even better.
This avoids the need for a constructor initialization too.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220323155743.1585078-12-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'softmmu/physmem.c')
-rw-r--r-- | softmmu/physmem.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 4e1b27a20e..cdf0db733e 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -1383,11 +1383,11 @@ long qemu_maxrampagesize(void) #else long qemu_minrampagesize(void) { - return qemu_real_host_page_size; + return qemu_real_host_page_size(); } long qemu_maxrampagesize(void) { - return qemu_real_host_page_size; + return qemu_real_host_page_size(); } #endif @@ -2163,7 +2163,7 @@ RAMBlock *qemu_ram_alloc_internal(ram_addr_t size, ram_addr_t max_size, new_block->max_length = max_size; assert(max_size >= size); new_block->fd = -1; - new_block->page_size = qemu_real_host_page_size; + new_block->page_size = qemu_real_host_page_size(); new_block->host = host; new_block->flags = ram_flags; ram_block_add(new_block, &local_err); |