anyways, it's littered with samples from the anime
@mitchmindtree haha, glad you recognized it! nice movie as well :)
@kvark the big reason I don't want to just disable a cell is that if you have some problem with generations overflowing you can effectively DOS the engine
which seems unlikely to be done without purpose
you're also introducing memory fragmentation
which defeats the whole purpose
the warning I referred to was just in the documentation
not a runtime log or anything
just explaining the caveat
I don't think it's particularly safe or unsafe either way honestly
you're handle is either valid or not
the bigger problem with this is handle invalidation
if you remove it, it's swaps with the item on the end
which invalidates any handles for that last item
the molecular musings post touches on a solution for that
but I hadn't really grokked it
@photex I read it yesterday, and didn't see a solution outside of just "please be careful to not overflow" also, let's structurize your points. Here is what I see:
you don't think it solves anything
is that a correct recap?
yep, but add 4) I honestly don't mind your solution. I'm just making sure we discuss it (helps me understand everything)
@photex ok, so let's go through the points:
I don't see why anyone would want to do that. Device is not exposed to the network, so we can assume whoever works with it is trusted
could you explain this bit? AFAIK, my solution covers that 1% of usecases where we alternatively either crash or go unsafe. Even if memory gets fragmented, it's an exception case and we can live with it
pretty much explained it in 2.
sure, no worries! I might be easily missing bits myself too
If the argument is about safety, then disabling a cell is certainly unsafe vs a generation overflow (my opinion).
when a generation is maxed and you can't add a new item in it's place, now you have a cell that is going to have to be skipped.
oops, that should be 2.
that's it. I think operationally it seems rare, but the engine data wasn't entirely meant to be used behind the scenes
I had anticipated it's use in game threads, scene graphs, etc
multi-line ahh ok Shift-Enter
why is disabling unsafe? EntityData may guarantee that nothing tries to use that handle
for all managing purposes, this handle is going to behave as being already used. I don't see any overhead of this in the code. Where do you see it being skipped exactly?
if you delete an item, generation is incremented, if it reaches LAST_GENERATION then from that point forward, the cell this relates to is no longer able to be used
so when iterating over the collection, you now have to check for a generation that equals LAST_GENERATION