summaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-10-03 13:36:49 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-10-03 13:36:49 +0000
commit8a8a608f6e2dc3d258bd765afa0aea6e1c33475c (patch)
tree52d2a4b7498d89478afc6af086c66b76feb97199 /exec.c
parentd63d307f6e00856dae25e9cd3d96bc0ba31ff107 (diff)
downloadqemu-8a8a608f6e2dc3d258bd765afa0aea6e1c33475c.tar.gz
use memset() (Daniel Egger)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1091 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/exec.c b/exec.c
index f266bb970d..5f2f69642d 100644
--- a/exec.c
+++ b/exec.c
@@ -315,7 +315,6 @@ static void page_flush_tb(void)
/* XXX: tb_flush is currently not thread safe */
void tb_flush(CPUState *env)
{
- int i;
#if defined(DEBUG_FLUSH)
printf("qemu: flush code_size=%d nb_tbs=%d avg_tb_size=%d\n",
code_gen_ptr - code_gen_buffer,
@@ -323,12 +322,10 @@ void tb_flush(CPUState *env)
nb_tbs > 0 ? (code_gen_ptr - code_gen_buffer) / nb_tbs : 0);
#endif
nb_tbs = 0;
- for(i = 0;i < CODE_GEN_HASH_SIZE; i++)
- tb_hash[i] = NULL;
+ memset (tb_hash, 0, CODE_GEN_HASH_SIZE * sizeof (void *));
virt_page_flush();
- for(i = 0;i < CODE_GEN_PHYS_HASH_SIZE; i++)
- tb_phys_hash[i] = NULL;
+ memset (tb_phys_hash, 0, CODE_GEN_PHYS_HASH_SIZE * sizeof (void *));
page_flush_tb();
code_gen_ptr = code_gen_buffer;
@@ -1279,8 +1276,7 @@ void tlb_flush(CPUState *env, int flush_global)
}
virt_page_flush();
- for(i = 0;i < CODE_GEN_HASH_SIZE; i++)
- tb_hash[i] = NULL;
+ memset (tb_hash, 0, CODE_GEN_HASH_SIZE * sizeof (void *));
#if !defined(CONFIG_SOFTMMU)
munmap((void *)MMAP_AREA_START, MMAP_AREA_END - MMAP_AREA_START);