lib: Add a lighter weight internal checksum wrapper
The faster (OpenSSL/GnuTLS) code lived in a `GInputStream` wrapper, and that adds a lot of weight (GObject + vtable calls). Move it into a simple autoptr-struct wrapper, and use it in the metadata path, so we're now using the faster checksums there too. This also drops a malloc there as the new API does hexdigest in place to a buffer. Prep for more work in the commit path to avoid `GInputStream` for local file commits, and ["adopting" files](https://github.com/ostreedev/ostree/pull/1255). Closes: #1256 Approved by: jlebon
This commit is contained in:
1 parent
bba7eb8069
commit
1c9975cbd1
9 files changed
+216
-176
No files matched your search
@@ -52,12 +52,6 @@ GType ot_checksum_instream_get_type (void) G_GNUC_CONST;
|
||||
|
||||
OtChecksumInstream * ot_checksum_instream_new (GInputStream *stream, GChecksumType checksum);
|
||||
|
||||
void ot_checksum_instream_get_digest (OtChecksumInstream *stream,
|
||||
guint8 *buffer,
|
||||
gsize *digest_len);
|
||||
|
||||
guint8* ot_checksum_instream_dup_digest (OtChecksumInstream *stream,
|
||||
gsize *ret_len);
|
||||
char * ot_checksum_instream_get_string (OtChecksumInstream *stream);
|
||||
|
||||
G_END_DECLS
|
||||
Reference in new issue
Block a user