-
-
Notifications
You must be signed in to change notification settings - Fork 28
feat(lifetime)!: debug info and wait_no_references #888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Benchmark Results for general
Comparing to 4c402d0 |
wait_no_references allows the packet bump allocator to wait until there are no more references before clearing the bump allocator instead of aborting if there are any references. Debug information is also added.
62070c5
to
3a0bedc
Compare
Benchmark Results for general
Comparing to 4c402d0 |
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## main #888 +/- ##
==========================================
+ Coverage 20.85% 20.87% +0.02%
==========================================
Files 161 161
Lines 16867 16931 +64
Branches 468 473 +5
==========================================
+ Hits 3518 3535 +17
- Misses 13285 13332 +47
Partials 64 64
🚀 New features to boost your workflow:
|
can you go a little more into this? in which scenarios would all the references not be 0 by the end of the gametick? I could see this causing issues if people accidentally hold onto references of say one event and then many bumps (massive memory) is never cleared |
See #861 as an example of where this would occur. When events such as ChatMessage are processed with a multi_threaded system, the event processing threads may still be running and holding references while the clear_bump system runs and calls assert_no_references.
This doesn't create multiple bump allocators. It waits until all references are cleared before clearing the bump allocator. If a reference is leaked, then wait_no_references will emit warnings every 5 seconds including debug information about which reference was leaked. |
ideally there should be a sync point before |
|
what I am saying though is why not use flecs for this natively instead of having our own custom logic? flecs has sync points natively. |
wait_no_references allows the packet bump allocator to wait until there are no more references before clearing the bump allocator instead of aborting if there are any references. Debug information is also added.