We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a813224 commit 095379cCopy full SHA for 095379c
src/main/kotlin/uno/buffer/buffer.kt
@@ -73,7 +73,9 @@ fun destroyBuf(vararg buffers: Buffer) {
73
MemoryUtil.memFree(buffers[i])
74
}
75
76
-fun ByteBuffer.use(block: () -> Unit) {
77
- block()
+fun ByteBuffer.use(block: (ByteBuffer) -> Unit) {
+ block(this)
78
destroy()
79
-}
+}
80
+
81
+fun withBufferBig(size: Int, block: (ByteBuffer) -> Unit) = bufferBig(size).use(block)
0 commit comments