[FIX] Fix class name parsing for some objects#271
[FIX] Fix class name parsing for some objects#271AbnormalPoof merged 1 commit intoFunkinCrew:experimentalfrom
Conversation
f1f8ace to
03bbe5b
Compare
03bbe5b to
8464978
Compare
EliteMasterEric
left a comment
There was a problem hiding this comment.
Since I fixed TObject to return String, the only thing this PR does is provide some caching for certain known types, right? What do you mean by TObject sometimes being a class type?
8464978 to
865bebf
Compare
Yeah, I guess. All the cache is for is to store the names of classes returned by |
Perfect, that was exactly what I was confused about. I thought the whole ordeal of using |
865bebf to
cb3e087
Compare
cb3e087 to
74bc520
Compare
7c4dfc1 to
813b64d
Compare
Co-authored-by: Kolo <67389779+KoloInDaCrib@users.noreply.github.com>
813b64d to
87b9b3c
Compare
|
oh, whoops lol |

Note
This PR now fixes some class types getting parsed to "Object" as if they were anonymous structures. You can still check out the original description below.
Original Description
https://github.com/larsiusprime/polymod/blob/7f82ddb3e11e33ad0dd42e0c3e1417edc90e38f9/polymod/hscript/_internal/PolymodInterpEx.hx#L1124-L1125
This snippet will convert any object to a string; some anon structures can contain string maps in them which will allocate memory when those are converted to strings when getting or setting a value. One a lot of mods seem to reference is
FlxG.save.datawhich can contain a lot of string maps, causing very frequent memory allocations.memory-leaky.mp4
Since a TObject can be either a class type or a struct I was compelled to either:
Type.getClassName(which is apparently slow even though all it does is access a field behind the scenes? Not saying it is, I just heard it from someone)I decided to go with the second since
getClassNamehas so much hatred. I haven't had the chance to test it thoroughly but testing the blacklist ofFlxSave.resolveFlixelClasses(static) andFlxSave.data(instance) and both worked, and the memory leak disappeared.