Add 64-bit support using int64 Address#71
Open
Mikusch wants to merge 38 commits into
Open
Conversation
…irtualAddress (unconditionally), SDKType_PlainOldData -> SDKType_VirtualAddress
…mmented out earlier, comment the SDKCall setup too
…tribute's union value
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on #67, this completes the x64 migration using the new int64-based Address type.
This requires 1.13.0.7377 or higher for alliedmodders/sourcemod#2487, which fixes a crash this plugin will run into otherwise.
The test suite added by @Malifox runs with no issues on 32-bit and 64-bit servers alike and I've even extended it a bit for greater test coverage.
No natives were removed. There are some caveats however:
String/non-networked attributes aren't supported on x64. There is no safe way to set string attributes from an x64 server plugin. Previous hacks won't work and there is not enough space for the 8-byte pointer. There is some hacky route involving writing to SOC, but that only works on actual GC-backed items unless we are willing to manually construct a
CEconItem(let's not).As such, all functions that can deal with these non-networked or string attributes are no-ops or throw native errors on 64-bit servers.
TF2Attrib_HookValueStringis the only string native that remains fully functional on x64.If it were up to me,
TF2Attrib_SetFromStringValueandTF2Attrib_UnsafeGetStringValueshould be deprecated, urging users to use other methods. As far as I'm aware, usage of these two natives is relatively sparse, with the biggest use case being values read from configs passed intoTF2Attrib_SetFromStringValuefor ease of use. But unless you are actually trying to target string attributes, setting attributes as float seems better to me anyway.