sourcemod/extensions/sdktools
Benoist 6439769d50
Some checks failed
Continuous Integration / ${{ matrix.os_short }}-${{ matrix.compiler_cc }} (clang, clang++, ubuntu-latest, linux) (push) Has been cancelled
Continuous Integration / ${{ matrix.os_short }}-${{ matrix.compiler_cc }} (clang-14, clang++-14, ubuntu-22.04, linux) (push) Has been cancelled
Continuous Integration / ${{ matrix.os_short }}-${{ matrix.compiler_cc }} (msvc, windows-latest, win) (push) Has been cancelled
hl2sdk-mock tests / mock (push) Has been cancelled
SourcePawn scripting / build (ubuntu-latest, linux) (push) Has been cancelled
SourcePawn scripting / build (windows-latest, win) (push) Has been cancelled
Introduce Virtual Address (#2226)
In the current ongoing effort for sourcemod to fully support 64 bits, we are introducing "virtual address".

# Explanation

Because SourcePawn does not yet support a 64 bits-wide type it's been impossible for any plugins to hold addresses in regular 32-bits wide variable.

A first attempt at solving this issue was made in commit ce1a4dcac0 therein dubbed "PseudoAddress", however this turned out to be an unsatisfactory solution, as any 'high' address if offsetted could turn invalid (or outright be impossible to map).

This leaves us with three alternatives :
- New type
- Convert Address into a handle
- Virtual Address

A new type is the most destructive solution, as it entails breaking every single Address related method. While that solution is still not off the table, we're reserving it as the last attempt should this commit fail.

Converting into a handle type is a good compromise between a brand new type whilst also preserving the Address methods. However, this comes with two issues: the first being that you can no longer offset Address, the second is that we would require authors to free the handle type which will be very confusing. This will likely not be implemented.

# Virtual address

Under a reasonable assumption, we've noted that the average plugin is unlikely to play with more than 4 GB of memory; this shouldn't be too surprising as all valve games were once 32bits and therefore limited to 4GB. Assuming this stays mostly true and a plugin isn't interested with the mapped memory of lesser known modules (like soundlib or matlib), it is fair to assume plugins are unlikely to access more than 4GB of mapped memory. Working with this in mind, we map the memory the plugins are likely to access to our custom virtual address ranges (from 0 to 4Gb, the values of which can fit on 32bits variable). If any memory was missed and plugins were to try an access it later those ranges will be late-mapped to our virtual address ranges until we run out of them.

In order to use virtual addressing, whether on 32 bits or 64 bits. Plugins must now "#include <virtual_address>", as well as use the new SDKCall_VirtualAddress, SDKType_VirtualAddress, LoadAddressFromAddress & StoreAddressToAddress where it's appropriate to.
2025-11-13 13:23:13 +01:00
..
AMBuilder CDetour safetyhook (#2162) 2024-05-21 01:53:44 +00:00
CellRecipientFilter.h Remove support for Source 1 Dota 2. (#496) 2016-04-26 23:18:47 -04:00
clientnatives.cpp Fix crash in ReconnectClient and Inactivate client when IServer ptr is null (bug 6122, r=asherkin). 2014-05-15 10:49:32 -04:00
clientnatives.h Added InactivateClient and ReconnectClient natives to SDKTools (bug 4931, r=fyren). 2011-07-06 18:11:02 -04:00
extension.cpp Add support for Military Conflict: Vietnam (#1887) 2022-12-20 21:46:18 +00:00
extension.h Add IntMap methodmap (#2018) 2024-10-31 23:35:41 +00:00
gamerulesnatives.cpp Fix storing garbage strings (#2257) 2025-02-19 13:10:37 +01:00
gamerulesnatives.h Added ability in SDKTools to get/set prop values on gamerules class (bug 4983, r=fyren). 2011-07-06 17:37:35 -04:00
hooks.cpp Manifest updates and compilation fixes for css, tf2, dods, hl2dm (#2268) 2025-02-20 00:51:38 +00:00
hooks.h Fix replay workaround not triggering (#2033) 2023-07-29 20:53:17 +00:00
inputnatives.cpp Add templated helper class to promote type-safety (#965) 2019-04-12 12:10:37 -07:00
output.cpp Manifest updates and compilation fixes for css, tf2, dods, hl2dm (#2268) 2025-02-20 00:51:38 +00:00
output.h CDetour safetyhook (#2162) 2024-05-21 01:53:44 +00:00
outputnatives.cpp Manifest updates and compilation fixes for css, tf2, dods, hl2dm (#2268) 2025-02-20 00:51:38 +00:00
smsdk_config.h sdktools_voice: implement ClientSpeaking forwards (#1247) 2020-08-18 06:02:34 -07:00
teamnatives.cpp Fix storing garbage strings (#2257) 2025-02-19 13:10:37 +01:00
teamnatives.h Add GetPlayerResourceEntity to SDKTools; deprecate old, broken TF2-specific impl (bug 5491, r=asherkin). 2013-03-16 13:50:36 -04:00
tempents.cpp Manifest updates and compilation fixes for css, tf2, dods, hl2dm (#2268) 2025-02-20 00:51:38 +00:00
tempents.h Add TE_WriteEnt and TE_ReadEnt natives to SDKTools. (#1905) 2023-01-14 14:48:05 +00:00
tenatives.cpp Add TE_WriteEnt and TE_ReadEnt natives to SDKTools. (#1905) 2023-01-14 14:48:05 +00:00
trnatives.cpp Expose custom sdktools trace types from hl2sdk (#1822) 2022-12-02 14:11:05 +01:00
util.h Added svn:keywords property to some files that didn't have them already 2008-04-10 19:28:26 +00:00
variant-t.cpp Incrase SetVariantString string limit (#2359) 2025-10-01 08:36:33 -04:00
variant-t.h AcceptEntityInput 64bit fix (#2149) 2024-05-05 20:06:06 +00:00
vcallbuilder.cpp Fix virtual SDKCall with object params (#1104) 2019-10-18 00:23:45 +01:00
vcallbuilder.h Spring Cleaning, Part Ichi (1) 2008-03-30 07:00:22 +00:00
vcaller.cpp Introduce Virtual Address (#2226) 2025-11-13 13:23:13 +01:00
vdecoder.cpp Introduce Virtual Address (#2226) 2025-11-13 13:23:13 +01:00
vdecoder.h Introduce Virtual Address (#2226) 2025-11-13 13:23:13 +01:00
version.rc Overhauled versioning information (bug 5453, r=dvander). 2012-08-26 01:33:54 +01:00
vglobals.cpp Manifest updates and compilation fixes for css, tf2, dods, hl2dm (#2268) 2025-02-20 00:51:38 +00:00
vglobals.h SDKTools: Clear gamerules pointer on level shutdown (#1755) 2022-04-22 11:48:21 +02:00
vhelpers.cpp Fix more sdktools crash on 64 bits (#2152) 2024-06-09 17:17:29 +00:00
vhelpers.h sdktools: Add EntityCollisionRulesChanged & SetEntityOwner natives (#1620) 2021-11-21 23:03:35 -08:00
vnatives.cpp Update SDKTools for Synergy (#2310) 2025-04-26 14:09:38 +00:00
vnatives.h Spring Cleaning, Part Ichi (1) 2008-03-30 07:00:22 +00:00
voice.cpp Cleanly remove all hooks on extension unload 2020-12-16 15:52:48 +01:00
vsound.cpp Add support for Military Conflict: Vietnam (#1887) 2022-12-20 21:46:18 +00:00
vsound.h Add support for Military Conflict: Vietnam (#1887) 2022-12-20 21:46:18 +00:00
vstringtable.cpp Make GetStringTableData native binary-safe (#1232) 2020-04-14 17:51:39 +01:00