Skip to content

Commit 095379c

Browse files
committed
- ByteBuffer.use (ByteBuffer) ->
- withBufferBig
1 parent a813224 commit 095379c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/main/kotlin/uno/buffer/buffer.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ fun destroyBuf(vararg buffers: Buffer) {
7373
MemoryUtil.memFree(buffers[i])
7474
}
7575

76-
fun ByteBuffer.use(block: () -> Unit) {
77-
block()
76+
fun ByteBuffer.use(block: (ByteBuffer) -> Unit) {
77+
block(this)
7878
destroy()
79-
}
79+
}
80+
81+
fun withBufferBig(size: Int, block: (ByteBuffer) -> Unit) = bufferBig(size).use(block)

0 commit comments

Comments
 (0)