aboutsummaryrefslogtreecommitdiffstats
path: root/mps/code
diff options
context:
space:
mode:
authorRichard Brooksby2012-05-01 17:25:25 +0100
committerRichard Brooksby2012-05-01 17:25:25 +0100
commit390f27c789bd212596f78c962fadafd652b0a186 (patch)
tree748939c57131ba1c5910f3ecd472e29bb0adf387 /mps/code
parent280386e6acfe6c93fef7dd90fc6cd4f00feee4fe (diff)
downloademacs-390f27c789bd212596f78c962fadafd652b0a186.tar.gz
emacs-390f27c789bd212596f78c962fadafd652b0a186.zip
Removing assertions for assumptions we no longer make since microsoft introduced size_t in its interfaces instead of dword. about time.
Copied from Perforce Change: 178081 ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code')
-rw-r--r--mps/code/vmw3.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/mps/code/vmw3.c b/mps/code/vmw3.c
index f864d315749..554209687d3 100644
--- a/mps/code/vmw3.c
+++ b/mps/code/vmw3.c
@@ -24,12 +24,6 @@
24 * a block of memory that occupies the last page in memory, so 24 * a block of memory that occupies the last page in memory, so
25 * that limit is representable and bigger than base. 25 * that limit is representable and bigger than base.
26 * 26 *
27 * .assume.dword-addr: We assume that the windows type DWORD and
28 * the MM type Addr are the same size.
29 *
30 * .assume.dword-align: We assume that the windows type DWORD and
31 * the MM type Align are assignment-compatible.
32 *
33 * .assume.lpvoid-addr: We assume that the windows type LPVOID and 27 * .assume.lpvoid-addr: We assume that the windows type LPVOID and
34 * the MM type Addr are assignment-compatible. 28 * the MM type Addr are assignment-compatible.
35 * 29 *
@@ -110,14 +104,14 @@ Res VMCreate(VM *vmReturn, Size size)
110 AVER(vmReturn != NULL); 104 AVER(vmReturn != NULL);
111 105
112 AVER(CHECKTYPE(LPVOID, Addr)); /* .assume.lpvoid-addr */ 106 AVER(CHECKTYPE(LPVOID, Addr)); /* .assume.lpvoid-addr */
113 AVER(sizeof(DWORD) == sizeof(Addr)); /* See .assume.dword-addr */ 107 AVER(CHECKTYPE(SIZE_T, Size));
114 AVER(CHECKTYPE(DWORD, Align)); /* See .assume.dword-align */
115 108
116 GetSystemInfo(&si); 109 GetSystemInfo(&si);
117 align = (Align)si.dwPageSize; 110 align = (Align)si.dwPageSize;
111 AVER((DWORD)align == si.dwPageSize); /* check it didn't truncate */
118 AVER(SizeIsP2(align)); /* see .assume.sysalign */ 112 AVER(SizeIsP2(align)); /* see .assume.sysalign */
119 size = SizeAlignUp(size, align); 113 size = SizeAlignUp(size, align);
120 if ((size == 0) || (size > (Size)(DWORD)-1)) 114 if ((size == 0) || (size > (Size)(SIZE_T)-1))
121 return ResRESOURCE; 115 return ResRESOURCE;
122 116
123 /* Allocate the vm descriptor. This is likely to be wasteful. */ 117 /* Allocate the vm descriptor. This is likely to be wasteful. */