1
0
mirror of https://github.com/fumiama/orbyte.git synced 2026-06-11 21:51:18 +08:00

optimize: change Destroy -> ManualDestroy

This commit is contained in:
源文雨
2025-02-25 19:35:43 +09:00
parent 343a5d57be
commit 4a462a1437
6 changed files with 41 additions and 25 deletions

View File

@@ -42,7 +42,7 @@ func testBuffer(buf *orbyte.Item[bytes.Buffer], t *testing.T) {
if !bytes.Equal(bufr.Pointer().Bytes(), buf.Pointer().Bytes()) {
t.Fatal("unexpected")
}
bufr.Destroy()
bufr.ManualDestroy()
bufcp = bufcp.Trans()
if bufcp.Pointer().Len() != 4096 {
@@ -51,7 +51,7 @@ func testBuffer(buf *orbyte.Item[bytes.Buffer], t *testing.T) {
if !bytes.Equal(bufcp.Pointer().Bytes(), buf.Pointer().Bytes()) {
t.Fatal("unexpected")
}
bufcp.Destroy()
bufcp.ManualDestroy()
runtime.GC()
runtime.Gosched()