RE: [PATCH v4 2/8] block alloc: add lifecycle APIs for cache_entry structs

2018-06-28 Thread Jameson Miller
> How much work is it to convert these to object_id while at it instead of char > *sha1? > (I think we really dislike introducing new sha1 based code; If it doesn't > sound > easy maybe we can have a static inline wrapper here that just converts oid to > sha1 and then calls this function?) I have

Re: [PATCH v4 2/8] block alloc: add lifecycle APIs for cache_entry structs

2018-06-21 Thread Stefan Beller
> --- a/cache.h > +++ b/cache.h > @@ -339,6 +339,29 @@ extern void remove_name_hash(struct index_state *istate, > struct cache_entry *ce) > extern void free_name_hash(struct index_state *istate); > > > +/* Cache entry creation and cleanup */ > + > +/* > + * Create cache_entry intended for use in

[PATCH v4 2/8] block alloc: add lifecycle APIs for cache_entry structs

2018-06-20 Thread Jameson Miller
Add an API around managing the lifetime of cache_entry structs. Abstracting memory management details behind this API will allow for alternative memory management strategies without affecting all the call sites. This commit does not change how memory is allocated or freed. A later commit in this s