Lines Matching refs:ptr
68 os_import_memory_fd(int fd, void **ptr, uint64_t *size, char const *driver_id)
92 *ptr = (void*)((uintptr_t)mapped_ptr + header.offset);
104 void *ptr, *buf;
133 ptr = mmap(NULL, alloc_size, PROT_READ | PROT_WRITE, MAP_SHARED, mem_fd, 0);
134 if (ptr == MAP_FAILED)
143 buf = (char *)(((uintptr_t)ptr + header_size + alignment - 1) & ~((uintptr_t)(alignment - 1)));
144 offset = (size_t)((uintptr_t)buf - (uintptr_t)ptr);
145 struct memory_header* header = (struct memory_header*)ptr;
170 os_free_fd(void *ptr)
172 if (ptr) {
173 size_t offset = ((size_t*)ptr)[-1];
174 struct memory_header* header = (struct memory_header*)((uintptr_t)ptr - offset);