From bfd40280723583c0b5013633cf4aa2108acccd97 Mon Sep 17 00:00:00 2001
From: Veit Heller
diff --git a/docs/StringBuf.html b/docs/StringBuf.html
index 6c13e0f..8710b7f 100644
--- a/docs/StringBuf.html
+++ b/docs/StringBuf.html
@@ -35,7 +35,7 @@
every call),
StringBuf tracks capacity and grows geometrically, giving
amortized O(1) appends.
(load "git@github.com:carpentry-org/strbuf@0.2.0")
+(load "git@github.com:carpentry-org/strbuf@0.2.1")
Usage
(let [sb (StringBuf.create)]
diff --git a/strbuf.carp b/strbuf.carp
index d30fe12..5e81c0d 100644
--- a/strbuf.carp
+++ b/strbuf.carp
@@ -6,7 +6,7 @@ amortized O(1) appends.
## Installation
```
-(load \"git@github.com:carpentry-org/strbuf@0.2.0\")
+(load \"git@github.com:carpentry-org/strbuf@0.2.1\")
```
## Usage
@@ -77,6 +77,7 @@ modifying the buffer.")
(doc delete "frees the buffer.")
(register delete (Fn [StringBuf] ()))
+ (implements delete StringBuf.delete)
(register copy (Fn [&StringBuf] StringBuf))
(implements copy StringBuf.copy))
diff --git a/test/strbuf.carp b/test/strbuf.carp
index 1eeb8df..36f2f75 100644
--- a/test/strbuf.carp
+++ b/test/strbuf.carp
@@ -155,4 +155,12 @@
&(let-do [sb (StringBuf.with-capacity 0)]
(StringBuf.append-str &sb "hello")
(let-do [s (StringBuf.to-string &sb)] (StringBuf.delete sb) s))
- "with-capacity 0 buffer grows and is usable"))
+ "with-capacity 0 buffer grows and is usable")
+
+ (assert-equal test
+ 0l
+ (do
+ (Debug.reset-memory-balance!)
+ (let [sb (StringBuf.create)] ())
+ (Debug.memory-balance))
+ "owned buffers are deleted automatically at scope exit"))