Skip to content
Snippets Groups Projects
Verified Commit 0a340a71 authored by Tomas Krizek's avatar Tomas Krizek
Browse files

utils/cache_gc/kr_cache_gc.c: replace asserts

parent 89370f74
Branches
Tags
1 merge request!1146lib/utils: define kr_require(), kr_assume() macros
......@@ -151,7 +151,8 @@ struct kr_cache_gc_state {
void kr_cache_gc_free_state(kr_cache_gc_state_t **state)
{
assert(state);
if (!kr_assume(state))
return;
if (!*state) { // not open
return;
}
......@@ -164,7 +165,8 @@ int kr_cache_gc(kr_cache_gc_cfg_t *cfg, kr_cache_gc_state_t **state)
{
// The whole function works in four "big phases":
//// 1. find out whether we should even do analysis and deletion.
assert(cfg && state);
if (!kr_assume(cfg && state))
return KNOT_EINVAL;
int ret;
// Ensure that we have open and "healthy" cache.
if (!*state) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment