Lines Matching refs:alloc
67 struct safe_allocation *alloc; in safe_alloc() local
72 alloc = malloc(size + offsetof(struct safe_allocation, data)); in safe_alloc()
73 if (!alloc) in safe_alloc()
76 alloc->size = size; in safe_alloc()
78 return &alloc->data; in safe_alloc()
83 struct safe_allocation *alloc; in safe_free() local
88 alloc = data - offsetof(struct safe_allocation, data); in safe_free()
90 memset(data, 0, alloc->size); in safe_free()
92 alloc->size = 0x55aa55aa; in safe_free()
93 free(alloc); in safe_free()
103 struct safe_allocation *alloc; in safe_realloc() local
105 alloc = data - offsetof(struct safe_allocation, data); in safe_realloc()
107 if (size > alloc->size) in safe_realloc()
108 size = alloc->size; in safe_realloc()