more minor fixes on things

This commit is contained in:
minjaesong
2020-11-23 15:54:21 +09:00
parent c3e3d8ecef
commit bb442231ea
2 changed files with 7 additions and 5 deletions

View File

@@ -83,12 +83,11 @@ internal class UnsafePtr(pointer: Long, allocSize: Long) {
}
private inline fun checkNullPtr(index: Long) { // ignore what IDEA says and do inline this
// commenting out because of the suspected (or minor?) performance impact.
// You may break the glass and use this tool when some fucking incomprehensible bugs ("vittujen vitun bugit")
// appear (e.g. getting garbage values when it fucking shouldn't)
assert(!destroyed) { throw NullPointerException("The pointer is already destroyed ($this)") }
//// commenting out because of the suspected (or minor?) performance impact.
//// You may break the glass and use this tool when some fucking incomprehensible bugs ("vittujen vitun bugit")
//// appear (e.g. getting garbage values when it fucking shouldn't)
// OOB Check: debugging purposes only -- comment out for the production
//assert(!destroyed) { throw NullPointerException("The pointer is already destroyed ($this)") }
//if (index !in 0 until size) throw IndexOutOfBoundsException("Index: $index; alloc size: $size")
}

View File

@@ -31,6 +31,9 @@ data class AdapterConfig(
val paletteShader: String = DRAW_SHADER_FRAG
)
/**
* NOTE: if TTY size is greater than 80*32, SEGFAULT will occur because text buffer is fixed in size
*/
open class GraphicsAdapter(val vm: VM, val config: AdapterConfig) :
GlassTty(config.textRows, config.textCols), PeriBase {