Back WeakDictionary with NSMapTable#3
Conversation
|
Okay, so this was actually expected behavior, and the values are released as soon as the current autorelease pool is. I reworked and polished my approach, and I think it works quite well now! It still seems like there is a quirk with how Most of the tests are currently failing because it expects a) it expects I have some local changes that make almost all tests pass, by sprinkling I'll push a commit with the semi-passing tests soon. @nicholascross In general, how do you feel about this approach? |
|
@LinusU Thanks Linus, I will take a look at this PR tonight. |
|
I remember having similar thoughts at some point but TBH it has been a long time since I thought about it. This article from back in the day highlights some of the pitfalls with In some respects you could draw similarities between Whilst I appreciate you are making an easier to use API by removing the need to reap orphaned references adding the
Maybe it is worth considering though, what your goal is. You want auto reaped references that
Would it be possible to extend or wrap |
I was toying with the idea of backing the WeakDictionary with NSMapTable, and it seems to be working. Unfortunately, I'm running into this problem with NSMapTable, and at this point, I'm starting to wonder if maybe
NSMapTableis just broken 🤔Any ideas? 😄