Lines Matching refs:cbAlloc
43 static int rtMemAllocExInRange(size_t cbAlloc, uint32_t fFlags, void **ppv, uintptr_t uAddr, uintptr_t uAddrLast)
57 && MemInfo.RegionSize >= cbAlloc)
59 void *pv = VirtualAlloc((void *)uAddr, cbAlloc, MEM_RESERVE | MEM_COMMIT, fPageProt);
65 AssertStmt(!pv, VirtualFree(pv, cbAlloc, MEM_RELEASE));
79 DECLHIDDEN(int) rtMemAllocEx16BitReach(size_t cbAlloc, uint32_t fFlags, void **ppv)
81 cbAlloc = RT_ALIGN_Z(cbAlloc, PAGE_SIZE);
82 AssertReturn(cbAlloc <= _64K - PAGE_SIZE, VERR_NO_MEMORY);
85 return rtMemAllocExInRange(cbAlloc, fFlags, ppv, PAGE_SIZE, _64K - cbAlloc);
89 DECLHIDDEN(int) rtMemAllocEx32BitReach(size_t cbAlloc, uint32_t fFlags, void **ppv)
91 cbAlloc = RT_ALIGN_Z(cbAlloc, PAGE_SIZE);
92 AssertReturn(cbAlloc <= _2G+_1G, VERR_NO_MEMORY);
98 void *pv = VirtualAlloc(NULL, cbAlloc, MEM_RESERVE | MEM_COMMIT, fPageProt);
101 if ((uintptr_t)pv + cbAlloc - 1 < _4G)
106 VirtualFree(pv, cbAlloc, MEM_RELEASE);
111 return rtMemAllocExInRange(cbAlloc, fFlags, ppv, _64K, _4G - cbAlloc);