A ready hit takes a reference; a hit still being built answers NULL (the * caller uses SQL rather than waiting on another thread's build). */
| 432 | /* A ready hit takes a reference; a hit still being built answers NULL (the |
| 433 | * caller uses SQL rather than waiting on another thread's build). */ |
| 434 | static cbm_graph_mem_t *gm_take(cbm_graph_mem_t *hit) { |
| 435 | if (!hit->ready) { |
| 436 | return NULL; |
| 437 | } |
| 438 | hit->refs++; |
| 439 | hit->last_use = ++g_use_clock; |
| 440 | return hit; |
| 441 | } |
| 442 | |
| 443 | static cbm_graph_mem_t *gm_new_entry(const char *db_path, const char *version, size_t est) { |
| 444 | cbm_graph_mem_t *g = cbm_calloc(CBM_MEM_CLASS_GRAPH_CACHE, sizeof(*g)); |
no outgoing calls
no test coverage detected