191
191
struct cache_entry *entry = apr_hash_get(cache->hash, key, cache->klen);
196
195
SVN_ERR(move_page_to_front(cache, entry->page));
198
197
/* duplicate the buffer entry */
199
198
*buffer = apr_palloc(result_pool, entry->size);
200
memcpy(*buffer, entry->value, entry->size);
200
memcpy(*buffer, entry->value, entry->size);
202
202
*size = entry->size;
205
210
return SVN_NO_ERROR;
213
218
apr_pool_t *result_pool)
215
220
inprocess_cache_t *cache = cache_void;
227
SVN_MUTEX__WITH_LOCK(cache->mutex,
228
inprocess_cache_get_internal(&buffer,
233
/* deserialize the buffer content. Usually, this will directly
234
modify the buffer content directly. */
235
*found = (buffer != NULL);
236
if (!buffer || !size)
239
return cache->deserialize_func(value_p, buffer, size, result_pool);
251
inprocess_cache_has_key_internal(svn_boolean_t *found,
252
inprocess_cache_t *cache,
254
apr_pool_t *scratch_pool)
256
*found = apr_hash_get(cache->hash, key, cache->klen) != NULL;
262
inprocess_cache_has_key(svn_boolean_t *found,
265
apr_pool_t *scratch_pool)
267
inprocess_cache_t *cache = cache_void;
220
270
SVN_MUTEX__WITH_LOCK(cache->mutex,
221
inprocess_cache_get_internal(&buffer,
271
inprocess_cache_has_key_internal(found,
227
/* deserialize the buffer content. Usually, this will directly
228
modify the buffer content directly.
231
*found = buffer != NULL;
232
return buffer && size
233
? cache->deserialize_func(value_p, buffer, size, result_pool)
237
281
/* Removes PAGE from the LRU list, removes all of its entries from