Skip to content

Commit

Permalink
core: make object cache LIFO
Browse files Browse the repository at this point in the history
was originally LIFO and I broke that when switching to the queue.h code.
This is friendlier for cache.
  • Loading branch information
dormando committed Jan 13, 2022
1 parent 6737943 commit 894e4c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void do_cache_free(cache_t *cache, void *ptr) {
free(ptr);
cache->total--;
} else {
STAILQ_INSERT_TAIL(&cache->head, (struct cache_free_s *)ptr, c_next);
STAILQ_INSERT_HEAD(&cache->head, (struct cache_free_s *)ptr, c_next);
cache->freecurr++;
}
}
Expand Down

0 comments on commit 894e4c1

Please sign in to comment.