From d0edeec8fb8fa5abee8b3065cea5e4882d0c51c4 Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Tue, 19 May 2020 11:39:21 +0300 Subject: make the atom functions not use global state This greatly helps with memory management on applications that may want to daemonize and open/close database several times. Also the lifetime and "owner" of memory for all data is now explicitly bound to owning struct apk_database, which might be helpful when writing language bindings. As side effect, the interned "atoms" are unique only within what apk_database, so comparing packages from different apk_database may not work as expected. Fixes #10697 --- src/app_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/app_info.c') diff --git a/src/app_info.c b/src/app_info.c index 41d6a99..b444b80 100644 --- a/src/app_info.c +++ b/src/app_info.c @@ -125,7 +125,7 @@ static void info_who_owns(struct info_ctx *ctx, struct apk_database *db, if (apk_verbosity < 1) { dep = (struct apk_dependency) { .name = pkg->name, - .version = apk_blob_atomize(APK_BLOB_NULL), + .version = &apk_atom_null, .result_mask = APK_DEPMASK_ANY, }; apk_deps_add(&deps, &dep); -- cgit v1.2.3-60-g2f50