Changeset 184 for trunk/lib/lru_cache.c
- Timestamp:
- 03/20/10 13:50:44 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/lru_cache.c
r169 r184 119 119 if(max_keys == 0) 120 120 ret_val->num_buckets = 1024; 121 else if(max_keys == 1) 122 ret_val->num_buckets = 1; 121 123 else 122 124 { … … 125 127 ret_val->num_buckets = 1; 126 128 } 127 129 128 130 ret_val->table = talloc_array(ret_val, 129 131 lru_cache_element*, ret_val->num_buckets); … … 177 179 */ 178 180 if(ht->talloc_data) 179 talloc_ free(e->data);181 talloc_unlink(e, e->data); 180 182 181 183 if(e->newer == NULL) … … 224 226 225 227 if(ht->talloc_data) 226 talloc_ free(e->data);228 talloc_unlink(e, e->data); 227 229 228 230 tmp_index = talloc_realloc_size(e, e->index, index_len); … … 261 263 e->data = data; 262 264 if(ht->talloc_data) 263 talloc_ steal(e, e->data);265 talloc_reference(e, e->data); 264 266 265 267 /* Finally, let's insert the element to the newest position in the LRU list.*/
Note: See TracChangeset
for help on using the changeset viewer.