```private fun IntArray?.initGroups(offset: Int) {...
# compose
m
Copy code
private fun IntArray?.initGroups(offset: Int) {
    if (this == null) return
    groupNext(0, NULL_ADDRESS)
    groupChild(0, offset)
}
What’s this method for?
Copy code
internal inline fun IntArray.groupNext(address: GroupAddress, value: Int) {
    this[address + SLOT_TABLE_GROUP_NEXT_OFFSET] = value
}
internal inline fun IntArray.groupChild(address: GroupAddress, value: Int) {
    this[address + SLOT_TABLE_GROUP_CHILD_OFFSET] = value
}
It sets the
next
address of group 0 to
NULL_ADDRESS
, effectively marking it as the last group, and… sets the address to its child to
offset
? What’s the declarative object of these imperative steps?
k
You have the top level comments at https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/composer/linkbuffer/SlotTableAddresSpace.kt;l=105;bpv=1;bpt=0 You have the CL description in the first commit of this file at https://cs.android.com/androidx/platform/frameworks/support/+/1435417aa61b0fbcc0e64ab49946568011579d2d that points to the previous implementation and multiple alternative explorations of this data structure. This is about as much as you can get about the internals for this and other similar questions.
☝🏻 1