diff options
| author | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2009-09-20 13:36:40 +0000 |
|---|---|---|
| committer | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2009-09-20 13:36:40 +0000 |
| commit | 3aa6ae9fd862cc04ce717c38984226381647bdc9 (patch) | |
| tree | 5e2fe8f08d37fa43487de6b500da5395794b9d81 | |
| parent | a9919e071277c735e4747f5dec1b4376f205cc1b (diff) | |
| download | pcsxr-3aa6ae9fd862cc04ce717c38984226381647bdc9.tar.gz | |
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@30152 e17a0e51-4ae3-4d35-97c3-1a29b211df97
| -rw-r--r-- | ChangeLog | 7 | ||||
| -rw-r--r-- | libpcsxcore/ix86/iR3000A.c | 2 | ||||
| -rw-r--r-- | win32/glue/sys/mman.h | 4 |
3 files changed, 9 insertions, 4 deletions
@@ -1,3 +1,10 @@ +September 20, 2009 Wei Mingzhi <weimingzhi@gmail.com> + + * win32/glue/sys/mman.h: Use VirtualAlloc() and VirtualFree() instead of + malloc() and free(). + * libpcsxcore/ix86/iR3000A.c: Minor cleanup. + * po/zh_TW.po: Updated. + September 18, 2009 Wei Mingzhi <weimingzhi@gmail.com> * win32/gui/CheatDlg.c: Disable "Search Type" combo box if search results diff --git a/libpcsxcore/ix86/iR3000A.c b/libpcsxcore/ix86/iR3000A.c index ad2e3c6e..b5629bd8 100644 --- a/libpcsxcore/ix86/iR3000A.c +++ b/libpcsxcore/ix86/iR3000A.c @@ -381,7 +381,6 @@ static int recInit() { psxRecLUT = (u32*) malloc(0x010000 * 4); - //recMem = (char*) malloc(RECMEM_SIZE); recMem = mmap(0, RECMEM_SIZE + 0x1000, PROT_EXEC | PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); @@ -417,7 +416,6 @@ static void recReset() { static void recShutdown() { if (recMem == NULL) return; free(psxRecLUT); - //free(recMem); munmap(recMem, RECMEM_SIZE + 0x1000); free(recRAM); free(recROM); diff --git a/win32/glue/sys/mman.h b/win32/glue/sys/mman.h index a803408a..35e8cd24 100644 --- a/win32/glue/sys/mman.h +++ b/win32/glue/sys/mman.h @@ -13,8 +13,8 @@ #include <stdlib.h>
#define mmap(start, length, prot, flags, fd, offset) \
- ((unsigned char *)malloc(length))
+ ((unsigned char *)VirtualAlloc(NULL, (length), MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE))
-#define munmap(start, length) do { free(start); } while (0)
+#define munmap(start, length) do { VirtualFree((start), (length), MEM_RELEASE); } while (0)
#endif
|
