Lines Matching refs:length
62 chunk->length = 0; in lexbor_mem_clean()
99 lexbor_mem_chunk_t *chunk, size_t length) in lexbor_mem_chunk_init() argument
101 length = lexbor_mem_align(length); in lexbor_mem_chunk_init()
103 if (length > mem->chunk_min_size) { in lexbor_mem_chunk_init()
104 if (mem->chunk_min_size > (SIZE_MAX - length)) { in lexbor_mem_chunk_init()
105 chunk->size = length; in lexbor_mem_chunk_init()
108 chunk->size = length + mem->chunk_min_size; in lexbor_mem_chunk_init()
115 chunk->length = 0; in lexbor_mem_chunk_init()
122 lexbor_mem_chunk_make(lexbor_mem_t *mem, size_t length) in lexbor_mem_chunk_make() argument
130 if (lexbor_mem_chunk_init(mem, chunk, length) == NULL) { in lexbor_mem_chunk_make()
157 lexbor_mem_alloc(lexbor_mem_t *mem, size_t length) in lexbor_mem_alloc() argument
159 if (length == 0) { in lexbor_mem_alloc()
163 length = lexbor_mem_align(length); in lexbor_mem_alloc()
165 if ((mem->chunk->length + length) > mem->chunk->size) { in lexbor_mem_alloc()
170 mem->chunk->next = lexbor_mem_chunk_make(mem, length); in lexbor_mem_alloc()
181 mem->chunk->length += length; in lexbor_mem_alloc()
183 return &mem->chunk->data[(mem->chunk->length - length)]; in lexbor_mem_alloc()
187 lexbor_mem_calloc(lexbor_mem_t *mem, size_t length) in lexbor_mem_calloc() argument
189 void *data = lexbor_mem_alloc(mem, length); in lexbor_mem_calloc()
192 memset(data, 0, length); in lexbor_mem_calloc()