summaryrefslogtreecommitdiff
path: root/lib/libalpm/deps.h
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-01-11 00:01:58 -0600
committerDan McGee <dan@archlinux.org>2008-01-11 00:01:58 -0600
commitccc1c731529de16f6fa4064fd992a8f63d7cfc26 (patch)
treedc5b96634cb255cfcbee1e57079d32491db9fc5e /lib/libalpm/deps.h
parent0a65de10b1cd8bd450e47e735cb909eec13822d0 (diff)
downloadpacman-ccc1c731529de16f6fa4064fd992a8f63d7cfc26.tar.xz
Use dynamic string allocation in package structures
This also affects all structures with static strings, such as depmiss, conflict, etc. This should help a lot with memory usage, and hopefully make things a bit more "idiot proof". Currently our pactest pass/fail rate is identical before and after this patch. This is not to say it is a perfect patch- I have yet to pull valgrind out. However, this should be quite safe to use in all situations from here on out, and we can start plugging the memleaks. Original-work-by: Aaron Griffin <aaronmgriffin@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/deps.h')
-rw-r--r--lib/libalpm/deps.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libalpm/deps.h b/lib/libalpm/deps.h
index 75cbb5bc..b20ea92f 100644
--- a/lib/libalpm/deps.h
+++ b/lib/libalpm/deps.h
@@ -29,13 +29,13 @@
/* Dependency */
struct __pmdepend_t {
pmdepmod_t mod;
- char name[PKG_NAME_LEN];
- char version[PKG_VERSION_LEN];
+ char *name;
+ char *version;
};
/* Missing dependency */
struct __pmdepmissing_t {
- char target[PKG_NAME_LEN];
+ char *target;
pmdepend_t depend;
};
@@ -50,6 +50,7 @@ struct __pmgraph_t {
pmdepmissing_t *_alpm_depmiss_new(const char *target, pmdepmod_t depmod,
const char *depname, const char *depversion);
+void _alpm_depmiss_free(pmdepmissing_t *miss);
alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, pmtranstype_t mode);
void _alpm_recursedeps(pmdb_t *db, alpm_list_t *targs, int include_explicit);
int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg,