Lines Matching refs:ptr

89     } ptr;  member
204 p->matrix[fl][sl] = b->ptr.free_ptr.next; in EXTRACT_BLOCK_HDR()
207 p->matrix[fl][sl]->ptr.free_ptr.prev = NULL; in EXTRACT_BLOCK_HDR()
215 b->ptr.free_ptr = (struct free_ptr) {NULL, NULL}; in EXTRACT_BLOCK_HDR()
226 if ( b->ptr.free_ptr.next ) in EXTRACT_BLOCK()
227 b->ptr.free_ptr.next->ptr.free_ptr.prev = in EXTRACT_BLOCK()
228 b->ptr.free_ptr.prev; in EXTRACT_BLOCK()
229 if ( b->ptr.free_ptr.prev ) in EXTRACT_BLOCK()
230 b->ptr.free_ptr.prev->ptr.free_ptr.next = in EXTRACT_BLOCK()
231 b->ptr.free_ptr.next; in EXTRACT_BLOCK()
234 p->matrix[fl][sl] = b->ptr.free_ptr.next; in EXTRACT_BLOCK()
242 b->ptr.free_ptr = (struct free_ptr) {NULL, NULL}; in EXTRACT_BLOCK()
246 ASSERT(!memchr_inv(b->ptr.buffer + MIN_BLOCK_SIZE, POISON_BYTE, in EXTRACT_BLOCK()
258 memset(b->ptr.buffer + MIN_BLOCK_SIZE, POISON_BYTE, in INSERT_BLOCK()
262 b->ptr.free_ptr = (struct free_ptr) {NULL, p->matrix[fl][sl]}; in INSERT_BLOCK()
264 p->matrix[fl][sl]->ptr.free_ptr.prev = b; in INSERT_BLOCK()
287 lb = GET_NEXT_BLOCK(b->ptr.buffer, b->size & BLOCK_SIZE_MASK); in ADD_REGION()
417 next_b = GET_NEXT_BLOCK(b->ptr.buffer, b->size & BLOCK_SIZE_MASK); in xmem_pool_alloc()
423 b2 = GET_NEXT_BLOCK(b->ptr.buffer, size); in xmem_pool_alloc()
444 return (void *)b->ptr.buffer; in xmem_pool_alloc()
454 void xmem_pool_free(void *ptr, struct xmem_pool *pool) in xmem_pool_free() argument
459 if ( unlikely(ptr == NULL) ) in xmem_pool_free()
462 b = (struct bhdr *)((char *) ptr - BHDR_OVERHEAD); in xmem_pool_free()
467 b->ptr.free_ptr = (struct free_ptr) { NULL, NULL}; in xmem_pool_free()
468 tmp_b = GET_NEXT_BLOCK(b->ptr.buffer, b->size & BLOCK_SIZE_MASK); in xmem_pool_free()
483 tmp_b = GET_NEXT_BLOCK(b->ptr.buffer, b->size & BLOCK_SIZE_MASK); in xmem_pool_free()
633 void *_xrealloc(void *ptr, unsigned long size, unsigned long align) in _xrealloc() argument
640 xfree(ptr); in _xrealloc()
644 if ( ptr == NULL || ptr == ZERO_BLOCK_PTR ) in _xrealloc()
651 if ( !((unsigned long)ptr & (PAGE_SIZE - 1)) ) in _xrealloc()
653 curr_size = (unsigned long)PFN_ORDER(virt_to_page(ptr)) << PAGE_SHIFT; in _xrealloc()
655 if ( size <= curr_size && !((unsigned long)ptr & (align - 1)) ) in _xrealloc()
656 return ptr; in _xrealloc()
672 p = strip_padding(ptr); in _xrealloc()
691 memcpy(p, ptr, min(curr_size, size)); in _xrealloc()
692 xfree(ptr); in _xrealloc()