-
-
Notifications
You must be signed in to change notification settings - Fork 448
SourceMod SDK: introduction into Valve memory system #1689
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: master
Are you sure you want to change the base?
Conversation
by components related to HL2SDK. Can be disabled with `META_NO_HL2SDK` definition
Thank you for the PR, but this is going to need a lot more description and rationale to consider merging. |
If I include separately sourcemod/public/smsdk_ext.cpp Lines 483 to 501 in 5611ec5
so I decided to embed |
I do think this might end up a little painful across games, there was a bunch of Source games that had memoveride disabled on Linux builds, so a lot of testing will be required (and CI isn't going to validate anything here). If your root issue is just cross-crt allocation around CUtlVector, you might be interested in a solution similar to #1165. Other than seeming like a large-ish linkage change here (which we've done worse of recently, and paid the support price), I'm not really for or against it, but would like the thoughts of @psychonic who knows the engine much better than I. |
Games that do not support MemAlloc overloading/override will be ignored Lines 623 to 625 in 4e3df76
sourcemod/public/sample_ext/AMBuildScript Lines 348 to 350 in 62cb6a0
I built and looked, they use malloc/free |
Another motivation to do this PR was what I saw in Valve binaries that they use MemAlloc overloading/override for binaries using |
I think this would probably be a net positive change, but the blast radius is huge. We need better ways to test these kinds of changes across all or most supported engines (or someone needs to test this one with brute force) before we can take this change. |
These changes to the overload of memory operators are necessary for components that include HL2SDK and subsequently static linking with the
tier1
! It was originally written to use theValve memory system
fromtier0
, so that through it there was an abstract opportunity to profile working with memory (g_pMemAlloc
) to find leaks.AMTL is not overloaded - it has a separate working environment with memory.