aboutsummaryrefslogtreecommitdiff
path: root/reftable/record.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-10-17 06:54:08 +0200
committerTaylor Blau <me@ttaylorr.com>2024-10-17 16:59:56 -0400
commit4abc8022ffae64bb24e93153c75bc880991bb2dc (patch)
treeba63e3e1e4a25962e13e70a79d610646da4e7120 /reftable/record.h
parente693ccf2c9427dfd5d93db723ac68f49f550ed38 (diff)
downloadgit-4abc8022ffae64bb24e93153c75bc880991bb2dc.tar.xz
reftable/record: adapt `reftable_record_key()` to handle allocation failures
The `reftable_record_key()` function cannot pass any errors to the caller as it has a `void` return type. Adapt it and its callers such that we can handle errors and start handling allocation failures. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 'reftable/record.h')
-rw-r--r--reftable/record.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/reftable/record.h b/reftable/record.h
index 271da3bf36..25aa908c85 100644
--- a/reftable/record.h
+++ b/reftable/record.h
@@ -40,7 +40,7 @@ int put_var_int(struct string_view *dest, uint64_t val);
/* Methods for records. */
struct reftable_record_vtable {
/* encode the key of to a uint8_t reftable_buf. */
- void (*key)(const void *rec, struct reftable_buf *dest);
+ int (*key)(const void *rec, struct reftable_buf *dest);
/* The record type of ('r' for ref). */
uint8_t type;
@@ -137,7 +137,7 @@ void reftable_record_init(struct reftable_record *rec, uint8_t typ);
/* see struct record_vtable */
int reftable_record_cmp(struct reftable_record *a, struct reftable_record *b);
int reftable_record_equal(struct reftable_record *a, struct reftable_record *b, int hash_size);
-void reftable_record_key(struct reftable_record *rec, struct reftable_buf *dest);
+int reftable_record_key(struct reftable_record *rec, struct reftable_buf *dest);
int reftable_record_copy_from(struct reftable_record *rec,
struct reftable_record *src, int hash_size);
uint8_t reftable_record_val_type(struct reftable_record *rec);