Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(446)

Unified Diff: src/trusted/service_runtime/arch/x86_32/sel_addrspace_x86_32.c

Issue 7648002: Modify the NaCl_page_alloc_hint function to use VirtualQuery to check (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/trusted/service_runtime/arch/x86_32/sel_addrspace_x86_32.c
===================================================================
--- src/trusted/service_runtime/arch/x86_32/sel_addrspace_x86_32.c (revision 6420)
+++ src/trusted/service_runtime/arch/x86_32/sel_addrspace_x86_32.c (working copy)
@@ -9,7 +9,6 @@
#include "native_client/src/trusted/service_runtime/sel_memory.h"
#include "native_client/src/trusted/service_runtime/sel_ldr.h"
-
NaClErrorCode NaClAllocateSpace(void **mem, size_t addrsp_size) {
int result;
@@ -26,6 +25,18 @@
*mem = (void *) NACL_TRAMPOLINE_START;
result = NaCl_page_alloc_at_addr(mem, addrsp_size);
*mem = 0;
+#elif NACL_WINDOWS && NACL_BUILD_SUBARCH == 32
+ /*
+ * On 32 bit Windows XP, a 1Gb region of address space is reserved before
Mark Seaborn 2011/08/16 20:18:43 Just say "32-bit Windows". It's not just XP.
+ * starting up this process to make sure we can get a contiguous block. Look
+ * for it and if found, pass the address to NaCl_page_alloc_at_addr so it can
+ * use this pre-reserved block.
+ */
+ if (0 == NaCl_find_prereserved_sandbox_memory(mem, addrsp_size)) {
+ result = NaCl_page_alloc_at_addr(mem, addrsp_size);
+ } else {
+ result = NaCl_page_alloc(mem, addrsp_size);
+ }
#else
result = NaCl_page_alloc(mem, addrsp_size);
#endif
« no previous file with comments | « no previous file | src/trusted/service_runtime/sel_memory.h » ('j') | src/trusted/service_runtime/win/sel_memory.c » ('J')

Powered by Google App Engine
This is Rietveld 408576698