[Native] Make StringTable and its builder internal
This commit is contained in:
+3
-3
@@ -119,7 +119,7 @@ data class SerializedFileReference(val fqName: String, val path: String) {
|
|||||||
constructor(irFile: IrFile) : this(irFile.packageFqName.asString(), irFile.path)
|
constructor(irFile: IrFile) : this(irFile.packageFqName.asString(), irFile.path)
|
||||||
}
|
}
|
||||||
|
|
||||||
private class StringTableBuilder {
|
internal class StringTableBuilder {
|
||||||
private val indices = mutableMapOf<String, Int>()
|
private val indices = mutableMapOf<String, Int>()
|
||||||
private var index = 0
|
private var index = 0
|
||||||
|
|
||||||
@@ -130,13 +130,13 @@ private class StringTableBuilder {
|
|||||||
fun build() = StringTable(indices)
|
fun build() = StringTable(indices)
|
||||||
}
|
}
|
||||||
|
|
||||||
private inline fun buildStringTable(block: StringTableBuilder.() -> Unit): StringTable {
|
internal inline fun buildStringTable(block: StringTableBuilder.() -> Unit): StringTable {
|
||||||
val builder = StringTableBuilder()
|
val builder = StringTableBuilder()
|
||||||
builder.block()
|
builder.block()
|
||||||
return builder.build()
|
return builder.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
private class StringTable(val indices: Map<String, Int>) {
|
internal class StringTable(val indices: Map<String, Int>) {
|
||||||
val sizeBytes: Int get() = Int.SIZE_BYTES + indices.keys.sumOf { Int.SIZE_BYTES + it.length * Char.SIZE_BYTES }
|
val sizeBytes: Int get() = Int.SIZE_BYTES + indices.keys.sumOf { Int.SIZE_BYTES + it.length * Char.SIZE_BYTES }
|
||||||
|
|
||||||
fun serialize(stream: ByteArrayStream) {
|
fun serialize(stream: ByteArrayStream) {
|
||||||
|
|||||||
Reference in New Issue
Block a user