Lines Matching refs:cs
218 struct string *cs, *tmp; in alloc_string() local
222 list_for_each_entry(cs, free_list, list) { in alloc_string()
223 if (cs->size < size) in alloc_string()
225 if (cs->size > size + sizeof(struct string)) { in alloc_string()
226 char *endaddr = (char *) (cs + 1) + cs->size; in alloc_string()
229 cs->size -= size + sizeof(struct string); in alloc_string()
230 cs = tmp; in alloc_string()
232 list_del(&cs->list); in alloc_string()
233 cs->len = len; in alloc_string()
234 INIT_LIST_HEAD(&cs->list); in alloc_string()
235 INIT_LIST_HEAD(&cs->update); in alloc_string()
236 return cs; in alloc_string()
242 free_string(struct list_head *free_list, struct string *cs) in free_string() argument
250 if (list_entry(p, struct string, list) > cs) in free_string()
257 if ((char *) (cs + 1) + cs->size == (char *) tmp) { in free_string()
259 cs->size += tmp->size + sizeof(struct string); in free_string()
265 if ((char *) (tmp + 1) + tmp->size == (char *) cs) { in free_string()
266 tmp->size += cs->size + sizeof(struct string); in free_string()
270 __list_add(&cs->list, left, left->next); in free_string()
271 return cs->size; in free_string()
277 struct string *cs; in add_string_memory() local
279 cs = (struct string *) mem; in add_string_memory()
280 cs->size = size - sizeof(struct string); in add_string_memory()
281 free_string(free_list, cs); in add_string_memory()