-
Notifications
You must be signed in to change notification settings - Fork 8
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
oh, look, a memory leak! #27
Comments
ewMagic has this problem many times |
I think all of the following logic cout be put into is own fuction to avoid copy pasta here.
|
This is a problem
the application is heap allocating here but it is not be clean up in w pointer goes out of scope.
|
This is why we don't like Conner's auto pointers and new->this
intailizers. They are great ideas but a measure of direction and sense is needed.
…On Thu, Sep 5, 2024, 10:04 PM Peter Wilson ***@***.***> wrote:
see the following warning
image.png (view on web)
<https://github.com/user-attachments/assets/a64edf89-182d-45f0-93a8-148ac3fd8035>
—
Reply to this email directly, view it on GitHub
<#27 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABV3W6LTRHHKQP5DR43GZLDZVEER7AVCNFSM6AAAAABGMXJO56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZTGA2DKMJSGE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
well there are 8 location to change. And I have analyzed a lot of the code base and found object life times and encapsulation to be very weak. In the past I have tryied clean it up on my one forks but there still so many more issues. |
Also it is dangerous to use memset and memcpy on non trival stucts and classes. See https://en.cppreference.com/w/cpp/language/classes#Trivial_class |
I will creeate a pr for this issue. |
There is an issue I have to try to resolve after all
|
I hate globals :( I am back to the drawing board for now. |
Did anyone try making the sprite_list counter and std::atomic and see if that can help? I am going to try an attack the problem from that angle |
Actually that may be a good idea. It doesn't cost much to make
something atomic and if it saves a thread crash, resources well spent.
…On Thu, 5 Sept 2024 at 23:03, Peter Wilson ***@***.***> wrote:
Did anyone try making the sprite_list counter and std::atomic and see if
that can help?
I am going to try an attack the problem from that angle
—
Reply to this email directly, view it on GitHub
<#27 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABV3W6OW5UBGSW6Y35CNHNDZVELPVAVCNFSM6AAAAABGMXJO56VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZTGEZTCNZYGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I in my most local change and getting 100 frame per second boost at least. |
If remove the frame cap, get like 2000 frames per second. |
If I remove the frame cap, in release build plays get like 4000 to 6000 frames per second. Before I would get like 450 frame per second. |
I have created my pr #29 |
Nice work. |
In weapons.cpp:
w=this; //Oh, look, a memory leak. The new instruction is making something on the heap, but this circumvents removing it.
The text was updated successfully, but these errors were encountered: