summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--buf.c2
-rw-r--r--buf.h1
-rw-r--r--chksum.c2
3 files changed, 3 insertions, 2 deletions
diff --git a/buf.c b/buf.c
index 4305952e..5d0fb268 100644
--- a/buf.c
+++ b/buf.c
@@ -130,7 +130,7 @@ val make_duplicate_buf(val len, mem_t *data)
return obj;
}
-static val make_owned_buf(val len, mem_t *data)
+val make_owned_buf(val len, mem_t *data)
{
val buf = make_borrowed_buf(len, data);
buf->b.size = len;
diff --git a/buf.h b/buf.h
index 683d5438..1805f3b8 100644
--- a/buf.h
+++ b/buf.h
@@ -29,6 +29,7 @@ val make_buf(val len, val init_val, val alloc_size);
val bufp(val object);
val make_borrowed_buf(val len, mem_t *data);
val init_borrowed_buf(obj_t *buf, val len, mem_t *data);
+val make_owned_buf(val len, mem_t *data);
val make_duplicate_buf(val len, mem_t *data);
val copy_buf(val buf);
val buf_trim(val buf);
diff --git a/chksum.c b/chksum.c
index ad12d7d4..215d4f57 100644
--- a/chksum.c
+++ b/chksum.c
@@ -97,7 +97,7 @@ static val chksum_ensure_buf(val self, val buf_in,
{
if (null_or_missing_p(buf_in)) {
*phash = chk_malloc(c_unum(len, self));
- return make_borrowed_buf(len, *phash);
+ return make_owned_buf(len, *phash);
} else {
*phash = buf_get(buf_in, self);
if (lt(length_buf(buf_in), len))