Commit 8a8a608f6e2dc3d258bd765afa0aea6e1c33475c
1 parent
d63d307f
use memset() (Daniel Egger)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1091 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
3 additions
and
7 deletions
exec.c
... | ... | @@ -315,7 +315,6 @@ static void page_flush_tb(void) |
315 | 315 | /* XXX: tb_flush is currently not thread safe */ |
316 | 316 | void tb_flush(CPUState *env) |
317 | 317 | { |
318 | - int i; | |
319 | 318 | #if defined(DEBUG_FLUSH) |
320 | 319 | printf("qemu: flush code_size=%d nb_tbs=%d avg_tb_size=%d\n", |
321 | 320 | code_gen_ptr - code_gen_buffer, |
... | ... | @@ -323,12 +322,10 @@ void tb_flush(CPUState *env) |
323 | 322 | nb_tbs > 0 ? (code_gen_ptr - code_gen_buffer) / nb_tbs : 0); |
324 | 323 | #endif |
325 | 324 | nb_tbs = 0; |
326 | - for(i = 0;i < CODE_GEN_HASH_SIZE; i++) | |
327 | - tb_hash[i] = NULL; | |
325 | + memset (tb_hash, 0, CODE_GEN_HASH_SIZE * sizeof (void *)); | |
328 | 326 | virt_page_flush(); |
329 | 327 | |
330 | - for(i = 0;i < CODE_GEN_PHYS_HASH_SIZE; i++) | |
331 | - tb_phys_hash[i] = NULL; | |
328 | + memset (tb_phys_hash, 0, CODE_GEN_PHYS_HASH_SIZE * sizeof (void *)); | |
332 | 329 | page_flush_tb(); |
333 | 330 | |
334 | 331 | code_gen_ptr = code_gen_buffer; |
... | ... | @@ -1279,8 +1276,7 @@ void tlb_flush(CPUState *env, int flush_global) |
1279 | 1276 | } |
1280 | 1277 | |
1281 | 1278 | virt_page_flush(); |
1282 | - for(i = 0;i < CODE_GEN_HASH_SIZE; i++) | |
1283 | - tb_hash[i] = NULL; | |
1279 | + memset (tb_hash, 0, CODE_GEN_HASH_SIZE * sizeof (void *)); | |
1284 | 1280 | |
1285 | 1281 | #if !defined(CONFIG_SOFTMMU) |
1286 | 1282 | munmap((void *)MMAP_AREA_START, MMAP_AREA_END - MMAP_AREA_START); | ... | ... |