diff options
author | David Hildenbrand <david@redhat.com> | 2022-10-14 15:47:14 +0200 |
---|---|---|
committer | David Hildenbrand <david@redhat.com> | 2022-10-27 11:00:28 +0200 |
commit | 6556aadc18c560e493b29dd99cae2cbf86d214cb (patch) | |
tree | 7d4b15d6988db2f112fab919483a2b783ad7856a /util/oslib-win32.c | |
parent | d0180f0acb142ca78e30857b8d8511ee9f3bd764 (diff) | |
download | qemu-6556aadc18c560e493b29dd99cae2cbf86d214cb.zip qemu-6556aadc18c560e493b29dd99cae2cbf86d214cb.tar.gz qemu-6556aadc18c560e493b29dd99cae2cbf86d214cb.tar.bz2 |
util: Cleanup and rename os_mem_prealloc()
Let's
* give the function a "qemu_*" style name
* make sure the parameters in the implementation match the prototype
* rename smp_cpus to max_threads, which makes the semantics of that
parameter clearer
... and add a function documentation.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Message-Id: <20221014134720.168738-2-david@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Diffstat (limited to 'util/oslib-win32.c')
-rw-r--r-- | util/oslib-win32.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/util/oslib-win32.c b/util/oslib-win32.c index 5723d3e..e1cb725 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -268,14 +268,14 @@ int getpagesize(void) return system_info.dwPageSize; } -void os_mem_prealloc(int fd, char *area, size_t memory, int smp_cpus, - Error **errp) +void qemu_prealloc_mem(int fd, char *area, size_t sz, int max_threads, + Error **errp) { int i; size_t pagesize = qemu_real_host_page_size(); - memory = (memory + pagesize - 1) & -pagesize; - for (i = 0; i < memory / pagesize; i++) { + sz = (sz + pagesize - 1) & -pagesize; + for (i = 0; i < sz / pagesize; i++) { memset(area + pagesize * i, 0, 1); } } |