Dylan Baker
9d82962160
fixup! cache: set the cache_table to NULL if empty
2022-08-02 11:51:29 -07:00
Dylan Baker
c7b0f86815
cache: set the cache_table to NULL if empty
...
Instead of realloc'ing to a size of 0, set the cache_table to NULL when
removing the last element from it.
2022-08-02 09:58:56 -07:00
Dylan Baker
d23dc2c183
cache: don't try to remove packages from the cache if it's NULL
...
Otherwise we end up reallocing the cache_table, when we shouldn't
2022-08-02 09:58:56 -07:00
Dylan Baker
a620e62286
cache: unref the package when removing it from the cache
2022-08-02 09:58:56 -07:00
Dylan Baker
36acd2e409
queue: don't collect static dependencies unless that's what we're looking for
...
Currently the required_private field gets walked twice, once when the
main required field is walked, and a second time when it is walked
itself. This results in the requires_private field leaking memory.
2022-08-02 09:58:06 -07:00
Dylan Baker
7b3346206e
dependency: unref dependency parent if it's set
...
libpkgconf never sets this internally, but it is in the API and someone
could set it (or libpkgconf could in the future), so let's clean up
after ourselves.
2022-08-02 09:58:06 -07:00
Dylan Baker
75a5fe0757
queue: ensure pkgconf_queue_apply alies cleanesup the world set
2022-08-02 09:58:06 -07:00
Dylan Baker
7025581da8
cache: use pkgconf_dependency_free instead of just setting match = NULL
...
This also means that we don't need to call unref on the pkgs, they've
already been freed by the dependency_free code
2022-07-27 13:59:24 -07:00
Dylan Baker
21a645df00
queue: when flattening sets, unref dependencies that will not be re-added
2022-07-27 13:40:27 -07:00
Dylan Baker
798f2dac74
dependency: assert that there is never a negative number of references
2022-07-27 13:21:13 -07:00
Dylan Baker
f809e0978e
cache: when removing a pkg from the cache, unset the cached flag
2022-07-27 12:17:59 -07:00
Dylan Baker
2f5a2c56d4
dependency: add a reference to dependency when adding to graph
...
This makes internal uses more annoying, but fixes a potential bug in
libpkgconf where there are two pointers (one returned and on in the
graph), but only one refcount.
2022-07-27 11:59:12 -07:00
Dylan Baker
7cd86508a3
dependency: add refcount trace to dependency
...
This works like the pkg tracing, but for dependencies
2022-07-27 11:27:18 -07:00
Dylan Baker
283050cc42
pkg: assert a package being freed has 0 references
2022-07-26 15:19:15 -07:00
Dylan Baker
0f4f170ce2
pkg: make debug trace provide the name of the (un)refed package
2022-07-26 15:19:15 -07:00
Dylan Baker
94b6d96794
queue: unref pkg copy in flatten_dependency_set
2022-07-26 15:19:15 -07:00
Dylan Baker
e9e7ebdbb6
cache: free allocated copy of cache_table in pkgconf_cache_free
2022-07-26 15:19:15 -07:00
Ariadne Conill
6c70781aad
introduce PKG_CONFIG_PKGCONF1_SYSROOT_RULES for legacy pkgconf behavior
2022-07-26 18:00:22 +00:00
Ariadne Conill
f8aefea7ec
pkg: add flags argument to pkgconf_pkg_new_from_file
2022-07-26 17:13:15 +00:00
Ariadne Conill
297e18f2c8
tuple: add flags parameter to pkgconf_tuple_parse
2022-07-26 17:08:48 +00:00
Ariadne Conill
b0802cb3d1
Revert "pkgconf_pkg_parser_value_set(): fix code-path ordering bug."
...
This reverts commit 13fe4c8c58
.
2022-06-26 19:41:31 +00:00
Ariadne Conill
72e429ae70
tuple: use ${pc_sysrootdir} instead of client->sysroot_dir where relevant
2022-06-26 19:35:19 +00:00
Ariadne Conill
a61193c723
pkg: fix sysroot_dir logic for github 213
2022-06-26 19:16:00 +00:00
Ariadne Conill
d68a867dc0
tuple: fall back to using globals rather than preferring them
2022-06-26 19:15:07 +00:00
Ariadne Conill
fdd7d192e0
queue: fix ISO C conformance for fallthrough label
2022-06-26 18:39:00 +00:00
Ariadne Conill
a1a415111f
queue: handle pkgconf_pkg_verify_dependency failure while flattening
2022-06-26 18:09:22 +00:00
Ariadne Conill
9bc6d80e61
queue: push new unresolved dependencies to the front of the queue, rather than the tail
2022-06-26 18:06:04 +00:00
Ariadne Conill
fe4db3aad9
queue: skip dependency collection for root node
2022-06-26 18:04:42 +00:00
Ariadne Conill
5a82a259ac
queue: use maxdepth after flattening
2022-06-26 15:17:08 +00:00
Ariadne Conill
a416dc1fd6
queue: advance client serial when walking requires.private for flattening
2022-06-26 15:16:36 +00:00
Ariadne Conill
197fcadd4c
queue: add flattening code
2022-06-26 15:02:37 +00:00
Ariadne Conill
5817e8848f
pkg: track the number of hits a package has gotten while solving for dependencies
2022-06-26 07:22:56 +00:00
Ariadne Conill
6ae17bd0ef
pkg: split pkgconf_pkg_traverse into a serial-modifying version
2022-06-26 06:05:40 +00:00
Ariadne Conill
ffa0805d58
cache: use pkgconf_reallocarray stub
2022-06-26 04:38:02 +00:00
Ariadne Conill
c1579d381c
bsdstubs: add pkgconf_reallocarray
2022-06-26 04:37:18 +00:00
Ariadne Conill
4c76f6bf01
meson: check for reallocarray
...
it is needed for the new cache code
2022-06-26 04:33:47 +00:00
Ariadne Conill
464672404e
cache: refactor to use a continguous table and bsearch
...
cache functions are the hottest part of the pkgconf code when
profiled, by removing the linked list for lookups, we can turn
lookups into an O(k) operation
2022-06-26 04:30:35 +00:00
Dylan Baker
c0fa7879b2
libpkgconf: zero path lists after freeing
...
This is required to make the pointer safely re-usable after being freed,
otherwise the list still says that it has nodes, but they point nowhere.
This is particularly important for libpkgconf, if a caller needs to
re-enter the library after freeing a path in a static path (such as the
default personality)
2022-06-26 03:12:34 +00:00
Dylan Baker
2d201af326
libpkgconf: Add a helper to zero `pkgconf_list_t`s
2022-06-26 03:12:34 +00:00
Ariadne Conill
cf48b61a59
stdinc: include strings.h on POSIX
2022-02-21 04:42:26 -06:00
Ariadne Conill
0995e49977
Merge branch 'master' into readme-meson
2022-02-21 04:27:11 -06:00
Ariadne Conill
a45dbccc01
Merge pull request #242 from data-man/dirent_latest
...
Update dirent.h to latest
2022-02-21 04:25:36 -06:00
Ariadne Conill
c6cfca6730
Merge pull request #245 from dcbaker/submit/remove-const
...
libpkgconf: remove const modifier from error_handler data pointer
2022-02-21 04:25:26 -06:00
Dylan Baker
c581e24a67
personality: use an unsigned to track initializations
...
Instead of a bool. The latter will result in de-initing leaving the
library unable to init again, which works out for the cli, but is
problematic for other consumers (meson++ and muon).
v2: - Add docs that the functions are not thread safe
2022-02-14 21:22:05 -08:00
Dylan Baker
f5d6bb71f8
libpkgconf: remove const modifier from error_handler data pointer
...
Currently, the data pointer is `const void *`, which means that the
handler can't modify the data without casting away the constness.
2022-02-07 09:34:09 -08:00
data-man
b132ce8317
Update dirent.h to latest
2022-01-08 10:55:28 +05:00
Andrea Pappacoda
6109e06089
docs: mention Meson instead of CMake for Win build
...
Fixes #233
2021-12-11 14:49:19 +01:00
Ariadne Conill
2b82a4f63e
use a serial instead of PKGCONF_PKG_PROPF_SEEN
2021-10-07 00:27:32 -06:00
Ariadne Conill
7d8cc1e4ce
dependency: add pkgconf_dependency_copy()
2021-10-06 13:13:34 -06:00
Ariadne Conill
c547edd07f
deconst the client on pkgconf_dependency_add()
2021-10-06 11:52:18 -06:00