Home | History | Annotate | Download | only in partition_allocator

Lines Matching refs:address

29 // On POSIX |mmap| uses a nearby address if the hint address is blocked.
37 // |VirtualAlloc| will fail if allocation at the hint address is blocked.
115 void* AllocPages(void* address,
123 DCHECK(!(reinterpret_cast<uintptr_t>(address) &
127 DCHECK(!(reinterpret_cast<uintptr_t>(address) & align_offset_mask));
129 // If the client passed null as the address, choose a good one.
130 if (!address) {
131 address = GetRandomPageBase();
132 address = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(address) &
138 void* ret = SystemAllocPages(address, length, page_accessibility);
145 address = reinterpret_cast<void*>(
148 } else if (!address) { // We know we're OOM when an unhinted allocation
153 address = reinterpret_cast<char*>(address) + align;
158 // Keep trying random addresses on systems that have a large address space.
159 address = GetRandomPageBase();
160 address = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(address) &
173 address = kHintIsAdvisory ? GetRandomPageBase() : nullptr;
174 ret = SystemAllocPages(address, try_length, page_accessibility);
184 void FreePages(void* address, size_t length) {
185 DCHECK(!(reinterpret_cast<uintptr_t>(address) &
189 int ret = munmap(address, length);
192 BOOL ret = VirtualFree(address, 0, MEM_RELEASE);
197 void SetSystemPagesInaccessible(void* address, size_t length) {
200 int ret = mprotect(address, length, PROT_NONE);
203 BOOL ret = VirtualFree(address, length, MEM_DECOMMIT);
208 bool SetSystemPagesAccessible(void* address, size_t length) {
211 return !mprotect(address, length, PROT_READ | PROT_WRITE);
213 return !!VirtualAlloc(address, length, MEM_COMMIT, PAGE_READWRITE);
217 void DecommitSystemPages(void* address, size_t length) {
220 int ret = madvise(address, length, MADV_FREE);
225 ret = madvise(address, length, MADV_DONTNEED);
229 SetSystemPagesInaccessible(address, length);
233 void RecommitSystemPages(void* address, size_t length) {
236 (void)address;
238 CHECK(SetSystemPagesAccessible(address, length));
242 void DiscardSystemPages(void* address, size_t length) {
249 DecommitSystemPages(address, length);
266 ret = discard_virtual_memory(address, length);
270 void* ret = VirtualAlloc(address, length, MEM_RESET, PAGE_READWRITE);