"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: Fix build with -DGOT_NO_OBJ_CACHE
To:
gameoftrees@openbsd.org
Date:
Thu, 16 Jun 2022 16:34:02 +0200

Download raw body.

Thread
On Thu, Jun 16, 2022 at 08:26:56AM -0600, Tracey Emery wrote:
> Building with -DGOT_NO_OBJ_CACHE fails with unused functions
> delta_cache_grow and delta_cache_resize.
> 
> This fixes it. Kill errant tab while here.
> 
> ok?
> 

Yes, thanks!
 
> diff 0ce35b66957ca0c2d19ae9833da0a3e607425d94 /home/tracey/src/got
> blob - ff7846b72bb4720eb8172eb46ef4b51f21df7f7c
> file + lib/delta_cache.c
> --- lib/delta_cache.c
> +++ lib/delta_cache.c
> @@ -79,7 +79,7 @@ got_delta_cache_alloc(struct got_delta_cache **new)
>  	cache = calloc(1, sizeof(*cache));
>  	if (cache == NULL)
>  		return got_error_from_errno("calloc");
> -	
> +
>  	cache->buckets = calloc(GOT_DELTA_CACHE_MIN_BUCKETS,
>  	    sizeof(cache->buckets[0]));
>  	if (cache->buckets == NULL) {
> @@ -125,6 +125,7 @@ delta_cache_hash(struct got_delta_cache *cache, off_t 
>  	return SipHash24(&cache->key, &delta_offset, sizeof(delta_offset));
>  }
>  
> +#ifndef GOT_NO_OBJ_CACHE
>  static const struct got_error *
>  delta_cache_resize(struct got_delta_cache *cache, unsigned int nbuckets)
>  {
> @@ -183,6 +184,7 @@ delta_cache_grow(struct got_delta_cache *cache)
>  
>  	return delta_cache_resize(cache, nbuckets);
>  }
> +#endif
>  
>  const struct got_error *
>  got_delta_cache_add(struct got_delta_cache *cache,
> 
>