Commit Diff


commit - cbfaaf20825023a414d1e834698bc588835f0ccf
commit + fa7a529ed4c1497b79f04fcd0484304e69b28873
blob - b8d6ef35517c4f74859324be5b8a53ec24206dd6
blob + 8918a1437eb3b268571ac5c39b2bca221de5438d
--- lib/delta_cache.c
+++ lib/delta_cache.c
@@ -92,6 +92,7 @@ got_delta_cache_free(struct got_delta_cache *cache)
 	free(cache);
 }
 
+#ifndef GOT_NO_OBJ_CACHE
 static void
 remove_least_used_element(struct got_delta_cache *cache)
 {
@@ -107,12 +108,15 @@ remove_least_used_element(struct got_delta_cache *cach
 	cache->nelem--;
 	cache->cache_evict++;
 }
+#endif
 
-
 const struct got_error *
 got_delta_cache_add(struct got_delta_cache *cache,
     off_t delta_data_offset, uint8_t *delta_data, size_t delta_len)
 {
+#ifdef GOT_NO_OBJ_CACHE
+	return got_error(GOT_ERR_NO_SPACE);
+#else
 	struct got_delta_cache_element *entry;
 
 	if (delta_len > cache->maxelemsize) {
@@ -134,6 +138,7 @@ got_delta_cache_add(struct got_delta_cache *cache,
 	TAILQ_INSERT_HEAD(&cache->entries, entry, entry);
 	cache->nelem++;
 	return NULL;
+#endif
 }
 
 void