-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Just found some memory hell (I finally switched to upstream glm again from my fork after all the time) and fixed it in 0c90ac2.
I have two ideas:
The first one is removing (or deprecating) all constructors or parameters wich use a Number
type. This wraps the primitive in an object (could be quite breaking though).
The second one is (at least for constructors) remove them too and replace them with inlined companion invoke operator functions:
previously:
class Vec1i(val x: Int) {
constructor(x: Number): this(x.i)
}
now (no Number allocation):
class Vec1i(val x: Int) {
companion object {
inline operator fun Vec1i.Companion.invoke(x: Number) = Vec1i(x.i)
}
}
What do you think?
Metadata
Metadata
Assignees
Labels
No labels