Lines Matching refs:ptr

75   void operator delete(void* ptr);
78 void Free(void* ptr);
92 void MapFree(void* ptr);
94 void FreeLocked(void* ptr);
97 void* ptr; member
131 void* ptr = mmap(NULL, map_size, prot, flags, -1, 0); in MapAligned() local
132 if (ptr == MAP_FAILED) { in MapAligned()
137 void* aligned_ptr = ptr; in MapAligned()
142 if (aligned_ptr != ptr) { in MapAligned()
143 ptrdiff_t extra = reinterpret_cast<uintptr_t>(aligned_ptr) - reinterpret_cast<uintptr_t>(ptr); in MapAligned()
144 munmap(ptr, extra); in MapAligned()
146 ptr = aligned_ptr; in MapAligned()
152 assert(ptr != NULL); in MapAligned()
153 munmap(reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(ptr) + size), map_size - size); in MapAligned()
157 prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, reinterpret_cast<uintptr_t>(ptr), size, in MapAligned()
161 return ptr; in MapAligned()
167 static void operator delete(void* ptr);
172 void Free(void* ptr);
176 static Chunk* ptr_to_chunk(void* ptr) { in ptr_to_chunk() argument
177 return reinterpret_cast<Chunk*>(reinterpret_cast<uintptr_t>(ptr) & ~(kChunkSize - 1)); in ptr_to_chunk()
179 static bool is_chunk(void* ptr) { in is_chunk() argument
180 return (reinterpret_cast<uintptr_t>(ptr) & (kChunkSize - 1)) != 0; in is_chunk()
205 unsigned int ptr_to_n(void* ptr) { in ptr_to_n() argument
206 ptrdiff_t offset = reinterpret_cast<uintptr_t>(ptr) - reinterpret_cast<uintptr_t>(data_); in ptr_to_n()
225 void Chunk::operator delete(void* ptr) { in operator delete() argument
226 assert(reinterpret_cast<Chunk*>(ptr) == ptr_to_chunk(ptr)); in operator delete()
227 munmap(ptr, kChunkSize); in operator delete()
271 void Chunk::Free(void* ptr) { in Free() argument
272 assert(is_chunk(ptr)); in Free()
273 assert(ptr_to_chunk(ptr) == this); in Free()
275 unsigned int n = ptr_to_n(ptr); in Free()
317 void HeapImpl::operator delete(void* ptr) { in operator delete() argument
318 munmap(ptr, kPageSize); in operator delete()
372 void HeapImpl::Free(void* ptr) { in Free() argument
374 FreeLocked(ptr); in Free()
377 void HeapImpl::FreeLocked(void* ptr) { in FreeLocked() argument
378 if (!Chunk::is_chunk(ptr)) { in FreeLocked()
379 HeapImpl::MapFree(ptr); in FreeLocked()
381 Chunk* chunk = Chunk::ptr_to_chunk(ptr); in FreeLocked()
383 chunk->Free(ptr); in FreeLocked()
391 void* ptr = MapAligned(size, kChunkSize); in MapAlloc() local
392 if (!ptr) { in MapAlloc()
396 allocation->ptr = ptr; in MapAlloc()
401 return ptr; in MapAlloc()
404 void HeapImpl::MapFree(void* ptr) { in MapFree() argument
406 while (*allocation && (*allocation)->ptr != ptr) allocation = &(*allocation)->next; in MapFree()
410 munmap((*allocation)->ptr, (*allocation)->size); in MapFree()
456 void Heap::deallocate(void* ptr) { in deallocate() argument
457 impl_->Free(ptr); in deallocate()
460 void Heap::deallocate(HeapImpl* impl, void* ptr) { in deallocate() argument
461 impl->Free(ptr); in deallocate()