[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/10] cputlb: Tidy memset() of arrays
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PULL 02/10] cputlb: Tidy memset() of arrays |
Date: |
Tue, 24 Dec 2013 13:58:53 +0100 |
From: Richard Henderson <address@hidden>
Don't duplicate the array length computation in the memset()
when plain sizeof() can produce the correct results.
Signed-off-by: Richard Henderson <address@hidden>
Reviewed-by: Aurelien Jarno <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
cputlb.c | 2 +-
translate-all.c | 5 ++---
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/cputlb.c b/cputlb.c
index d2da404..9270055 100644
--- a/cputlb.c
+++ b/cputlb.c
@@ -57,7 +57,7 @@ void tlb_flush(CPUArchState *env, int flush_global)
cpu->current_tb = NULL;
memset(env->tlb_table, -1, sizeof(env->tlb_table));
- memset(env->tb_jmp_cache, 0, TB_JMP_CACHE_SIZE * sizeof (void *));
+ memset(env->tb_jmp_cache, 0, sizeof(env->tb_jmp_cache));
env->tlb_flush_addr = -1;
env->tlb_flush_mask = 0;
diff --git a/translate-all.c b/translate-all.c
index 1c63d78..105c25a 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -703,11 +703,10 @@ void tb_flush(CPUArchState *env1)
CPU_FOREACH(cpu) {
CPUArchState *env = cpu->env_ptr;
- memset(env->tb_jmp_cache, 0, TB_JMP_CACHE_SIZE * sizeof(void *));
+ memset(env->tb_jmp_cache, 0, sizeof(env->tb_jmp_cache));
}
- memset(tcg_ctx.tb_ctx.tb_phys_hash, 0,
- CODE_GEN_PHYS_HASH_SIZE * sizeof(void *));
+ memset(tcg_ctx.tb_ctx.tb_phys_hash, 0,
sizeof(tcg_ctx.tb_ctx.tb_phys_hash));
page_flush_tb();
tcg_ctx.code_gen_ptr = tcg_ctx.code_gen_buffer;
--
1.8.4
- [Qemu-devel] [PULL 00/10] QOM CPUState patch queue 2013-12-24, Andreas Färber, 2013/12/24
- [Qemu-devel] [PULL 02/10] cputlb: Tidy memset() of arrays,
Andreas Färber <=
- [Qemu-devel] [PULL 01/10] cputlb: Use memset() when flushing entries, Andreas Färber, 2013/12/24
- [Qemu-devel] [PULL 04/10] cpu-exec: Optimize X86CPU usage in cpu_exec(), Andreas Färber, 2013/12/24
- [Qemu-devel] [PULL 03/10] target-i386: Move apic_state field from CPUX86State to X86CPU, Andreas Färber, 2013/12/24
- [Qemu-devel] [PULL 07/10] target-i386: Convert 'hv_spinlocks' to static property, Andreas Färber, 2013/12/24
- [Qemu-devel] [PULL 09/10] target-i386: Cleanup 'foo' feature handling, Andreas Färber, 2013/12/24
- [Qemu-devel] [PULL 06/10] target-i386: Convert 'hv_vapic' to static property, Andreas Färber, 2013/12/24
- [Qemu-devel] [PULL 10/10] target-i386: Cleanup 'foo=val' feature handling, Andreas Färber, 2013/12/24
- [Qemu-devel] [PULL 05/10] target-i386: Convert 'hv_relaxed' to static property, Andreas Färber, 2013/12/24
- [Qemu-devel] [PULL 08/10] target-i386: Convert 'check' and 'enforce' to static properties, Andreas Färber, 2013/12/24