Patch from davefiddes. Original commit message :
This fixes the following warnings:
codegen_allocator.c:
- implict function declaration of rand() due to missing stdlib.h
codegen_backend_x86-64.c:
- implict function declaration of malloc() due to missing stdlib.h
- unused variables in codegen_backend_init()
- invalid typecast in use of host_x86_CALL()
codegen_backend_x86-64-uop.c:
- Remove unused variable declarations in codegen_CALL_FUNC_RESULT(),
codegen_LOAD_SEG(), codegen_OR_IMM(), codegen_XOR() and codegen_XOR_IMM()
- Move debug only variable declarations under the debug conditional define in
codegen_CALL_FUNC_RESULT(), codegen_LOAD_SEG(), codegen_MEM_LOAD_SINGLE(),
codegen_MEM_LOAD_DOUBLE(), codegen_MEM_STORE_SINGLE(),
codegen_MEM_STORE_DOUBLE()
codegen_reg.c:
- Change (int) typecasts to the correct (intptr_t) for small values stored
in a pointer. This fixes a series of 64-bit compilation warnings.
Tests:
- Build with no warnings on Fedora 32 with gcc 10.1
- Boot a Win98 machine with dynamic compilation enabled
Also maintain a list of memory pages with dirty code blocks that can be evicted. This allows the recompiler to evict dirty blocks in preference to freeing usable blocks when the free list is empty.
Increase the number of available code blocks on x86.
Increase the non-ARM code allocator memory to 128 MB.
This reduces the amount of code block churning when running software with a lot of code, eg Windows XP.