From 088f9663baf76b2da33446158b02b3a03b316ec7 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Thu, 28 Dec 2023 20:08:50 +0100 Subject: Add note about nproc() memory allocation --- cbs.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cbs.h b/cbs.h index 28c1d1e..aab8dfa 100644 --- a/cbs.h +++ b/cbs.h @@ -165,7 +165,11 @@ static int nproc(void); This function returns true on success and false if pkg-config is not found on the system. To check for pkg-configs existance without doing anything meaningful, you can call this function with flags set to 0 and lib set to a - VALID library name. */ + VALID library name. + + The arguments this function appends to the given command are heap-allocated. + If you care about free()ing them, you can figure out their indicies in + cmd.argv by getting cmd.len both before- and after calling this function. */ static bool pcquery(struct cmd *, char *lib, int flags); enum pkg_config_flags { PKGC_LIBS = 1 << 0, -- cgit v1.2.3