Lines Matching refs:cs
219 struct string *cs, *tmp; in alloc_string() local
223 list_for_each_entry(cs, free_list, list) { in alloc_string()
224 if (cs->size < size) in alloc_string()
226 if (cs->size > size + sizeof(struct string)) { in alloc_string()
227 char *endaddr = (char *) (cs + 1) + cs->size; in alloc_string()
230 cs->size -= size + sizeof(struct string); in alloc_string()
231 cs = tmp; in alloc_string()
233 list_del(&cs->list); in alloc_string()
234 cs->len = len; in alloc_string()
235 INIT_LIST_HEAD(&cs->list); in alloc_string()
236 INIT_LIST_HEAD(&cs->update); in alloc_string()
237 return cs; in alloc_string()
243 free_string(struct list_head *free_list, struct string *cs) in free_string() argument
251 if (list_entry(p, struct string, list) > cs) in free_string()
258 if ((char *) (cs + 1) + cs->size == (char *) tmp) { in free_string()
260 cs->size += tmp->size + sizeof(struct string); in free_string()
266 if ((char *) (tmp + 1) + tmp->size == (char *) cs) { in free_string()
267 tmp->size += cs->size + sizeof(struct string); in free_string()
271 __list_add(&cs->list, left, left->next); in free_string()
272 return cs->size; in free_string()
278 struct string *cs; in add_string_memory() local
280 cs = (struct string *) mem; in add_string_memory()
281 cs->size = size - sizeof(struct string); in add_string_memory()
282 free_string(free_list, cs); in add_string_memory()