core: Add malloc-free API for objects, use *at functions for storing

This is more efficient; we avoid malloc of a number of pathname +
GFile objects, plus the kernel doesn't have to traverse the repo path
again.
This commit is contained in:
Colin Walters committed 2013-09-07 04:18:41 -04:00
1 parent 2506e8fb26
commit a7c0992d94
8 files changed
+180 -108

No files matched your search

+17
View File
@@ -74,6 +74,23 @@ gboolean _ostree_write_variant_with_size (GOutputStream *output,
GCancellable *cancellable,
GError **error);
/* XX + / + checksum-2 + . + extension, but let's just use 256 for a
* bit of overkill.
*/
#define _OSTREE_LOOSE_PATH_MAX (256)
void
_ostree_loose_path (char *buf,
const char *checksum,
OstreeObjectType objtype,
OstreeRepoMode repo_mode);
void
_ostree_loose_path_with_suffix (char *buf,
const char *checksum,
OstreeObjectType objtype,
OstreeRepoMode repo_mode,
const char *suffix);
G_END_DECLS