godot.core.LongStringQueue.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of godot-library-release Show documentation
Show all versions of godot-library-release Show documentation
Contains godot api as kotlin classes and jvm cpp interaction code.
package godot.core
import java.util.*
internal object LongStringQueue {
// If changed, remember to change also max_string_size in long_string_queue.cpp and the StringTest.kt
var stringMaxSize = 512
private val stringQueue = ThreadLocal.withInitial {
ArrayDeque(5)
}
fun queueString(str: String) {
stringQueue.get().addLast(str)
}
fun pollString(): String {
return stringQueue.get().pollFirst()
}
external fun sendStringToCPP(str: String)
}