Lines Matching refs:buffer
39 buffer_t *buffer = osi_calloc(sizeof(buffer_t) + size); in buffer_new() local
41 buffer->root = buffer; in buffer_new()
42 buffer->refcount = 1; in buffer_new()
43 buffer->length = size; in buffer_new()
45 return buffer; in buffer_new()
69 void buffer_free(buffer_t *buffer) { in buffer_free() argument
70 if (!buffer) in buffer_free()
73 if (buffer->root != buffer) { in buffer_free()
75 if (--buffer->root->refcount == 0) in buffer_free()
76 osi_free(buffer->root); in buffer_free()
77 osi_free(buffer); in buffer_free()
78 } else if (--buffer->refcount == 0) { in buffer_free()
80 osi_free(buffer); in buffer_free()