What is the order of function returned by val <KCl...
# announcements
n
What is the order of function returned by val KClass<*>.memberFunctions: Collection<KFunction<*>> , is it the order of declaration?
r
I wouldn’t make any assumptions here.
👍 1
Probably at the whim of the compiler.
👍 1
g
I know that at runtime one of the key performance advantages the JVM has over C is that the JVM gets to re-order fields according to a heuristic. And the implemention of
Unsafe
makes implications that this is done eagerly. So my guess is: you get them back in the order that the JVM thought would be fastest --effectively random.