Lines Matching refs:ptr
36 void *ptr; in kmem_zalloc_greedy() local
39 while (!(ptr = kmem_zalloc_large(kmsize))) { in kmem_zalloc_greedy()
43 if (ptr) in kmem_zalloc_greedy()
45 return ptr; in kmem_zalloc_greedy()
53 void *ptr; in kmem_alloc() local
56 ptr = kmalloc(size, lflags); in kmem_alloc()
57 if (ptr || (flags & (KM_MAYFAIL|KM_NOSLEEP))) in kmem_alloc()
58 return ptr; in kmem_alloc()
70 void *ptr; in kmem_zalloc() local
72 ptr = kmem_alloc(size, flags); in kmem_zalloc()
73 if (ptr) in kmem_zalloc()
74 memset((char *)ptr, 0, (int)size); in kmem_zalloc()
75 return ptr; in kmem_zalloc()
79 kmem_free(const void *ptr) in kmem_free() argument
81 if (!is_vmalloc_addr(ptr)) { in kmem_free()
82 kfree(ptr); in kmem_free()
84 vfree(ptr); in kmem_free()
89 kmem_realloc(const void *ptr, size_t newsize, size_t oldsize, in kmem_realloc() argument
95 if (ptr) { in kmem_realloc()
97 memcpy(new, ptr, in kmem_realloc()
99 kmem_free(ptr); in kmem_realloc()
109 void *ptr; in kmem_zone_alloc() local
112 ptr = kmem_cache_alloc(zone, lflags); in kmem_zone_alloc()
113 if (ptr || (flags & (KM_MAYFAIL|KM_NOSLEEP))) in kmem_zone_alloc()
114 return ptr; in kmem_zone_alloc()
126 void *ptr; in kmem_zone_zalloc() local
128 ptr = kmem_zone_alloc(zone, flags); in kmem_zone_zalloc()
129 if (ptr) in kmem_zone_zalloc()
130 memset((char *)ptr, 0, kmem_cache_size(zone)); in kmem_zone_zalloc()
131 return ptr; in kmem_zone_zalloc()