sourcemod/plugins/include
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
..
admin.inc Add bitwise SetBitFlags for AdminId and GroupId (#1677) 2022-02-12 13:14:57 +01:00
adminmenu.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
adt_array.inc Add new options to ArrayList FindString, FindValue (#2216) 2025-11-08 17:03:42 +00:00
adt_stack.inc Update adt_stack.inc (#2313) 2025-04-27 18:03:49 -04:00
adt_trie.inc Add IntMap methodmap (#2018) 2024-10-31 23:35:41 +00:00
adt.inc added amb1538 - adt_stack 2008-04-13 06:06:27 +00:00
banning.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
basecomm.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
bitbuffer.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
clientprefs.inc Increase Cookie.GetInt/SetInt buffer size (#1995) 2023-04-22 01:19:36 -07:00
clients.inc Add OnServerHibernationUpdate forward (closes #1483) (#2151) 2024-05-07 01:44:56 +00:00
commandfilters.inc core: Add client id to MultiTargetFilter forward (#1070) 2021-03-08 10:04:11 -08:00
commandline.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
console.inc Add CommandIterator.ConVarFlags property (#1869) 2022-12-04 12:24:56 +01:00
convars.inc Removed incorrect parameter RemoveChangeHook desc 2021-10-23 11:28:23 -05:00
core.inc Update SourcePawn. 2023-11-02 18:38:30 -10:00
cstrike.inc cstrike.csgo: Add native to retrieve loadout slot of weapon (#1241) 2023-03-29 21:27:45 -07:00
datapack.inc Add an array operations to CDataPack (#1219) 2020-05-08 15:23:48 -07:00
dbi.inc database: flip to recursive_mutex to allow nested locks (#1937) 2023-03-29 20:03:03 -07:00
dhooks.inc Add the ability to work with the |this| parameter under dhooks callback (#2219) 2025-11-06 16:33:41 +01:00
entity_prop_stocks.inc Fix SetEntityHealth to support 'any' entities (#1846) 2022-12-20 22:07:57 +00:00
entity.inc Implement raw entity handle accessors (#1830) 2022-12-29 03:57:47 +00:00
entitylump.inc Add functions for working with entity lumps (#1673) 2022-09-05 15:44:58 -07:00
events.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
files.inc Add GetFilePermissions (#2177) 2024-06-08 14:17:50 +00:00
float.inc Fix incorrect param order and docs on ArcTangent2 (fixes #2312) 2025-04-27 11:12:57 -04:00
functions.inc Add void function prototypes to NativeCall and MenuHandler (#2081) 2023-12-18 23:57:58 +00:00
geoip.inc Update GeoIP2 extension to new GeoLite2 .mmdb database format (#1245) 2021-06-30 13:01:12 +02:00
halflife.inc Stop EntRefToEntIndex returning garbage if a bad parameter is passed (#1323) 2024-04-25 23:19:04 +00:00
handles.inc Add Clone to Handle methodmap 2024-10-19 13:20:20 -04:00
helpers.inc Add comment about common.phrases to FindTarget (#1155) 2020-01-14 15:00:27 -08:00
keyvalues.inc Make KeyValues.Rewind traversal-stack clearing optional (#1993) 2023-04-17 13:10:02 +01:00
lang.inc Add GetClientOriginalLanguage (#1810) 2022-07-28 18:10:51 -07:00
logging.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
mapchooser.inc Reduce code size for strict dependencies on mapchooser (#1528) 2021-07-22 14:37:43 +02:00
menus.inc Add void function prototypes to NativeCall and MenuHandler (#2081) 2023-12-18 23:57:58 +00:00
nextmap.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
profiler.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
protobuf.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
regex.inc regex: add/document missing offset param (#1175) 2020-02-26 15:52:04 -08:00
sdkhooks.inc Add note about automatic unhook (#1910) 2023-01-22 10:23:40 +01:00
sdktools_client.inc Documentation corrections and additions (#1498) 2021-06-24 15:45:01 +01:00
sdktools_engine.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
sdktools_entinput.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
sdktools_entoutput.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
sdktools_functions.inc SDKTools: Add explode parameter to ForcePlayerSuicide native (#1782) 2022-07-07 14:14:50 +02:00
sdktools_gamerules.inc Support reading legacy sendprop arrays (#1550) 2021-08-23 21:21:11 +01:00
sdktools_hooks.inc Add a OnPlayerRunCmdPre forward (#1760) 2022-04-25 14:00:53 -07:00
sdktools_sound.inc Fix sound flags enumeration (#2040) 2023-09-27 17:03:03 +02:00
sdktools_stocks.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
sdktools_stringtables.inc Documentation corrections and additions (#1498) 2021-06-24 15:45:01 +01:00
sdktools_tempents_stocks.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
sdktools_tempents.inc Add TE_WriteEnt and TE_ReadEnt natives to SDKTools. (#1905) 2023-01-14 14:48:05 +00:00
sdktools_trace.inc Expose custom sdktools trace types from hl2sdk (#1822) 2022-12-02 14:11:05 +01:00
sdktools_variant_t.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
sdktools_voice.inc Documentation corrections and additions (#1498) 2021-06-24 15:45:01 +01:00
sdktools.inc Introduce Virtual Address (#2226) 2025-11-13 13:23:13 +01:00
sorting.inc Revert "Update sourcepawn submodule (#2146)" 2024-06-08 09:26:13 -04:00
sourcemod.inc Introduce Virtual Address (#2226) 2025-11-13 13:23:13 +01:00
string.inc Add more context to Format etc documentation (#2079) 2023-11-06 16:07:00 +00:00
testing.inc Run basic native tests using hl2sdk-mock in CI (#2015) 2023-07-12 22:58:28 +02:00
textparse.inc Add SMCParser.ParseString (#1817) 2022-12-02 16:55:08 +01:00
tf2_stocks.inc Add new TF_CUSTOM_* values (#2360) 2025-10-02 10:43:37 +02:00
tf2.inc Add TFHoliday_Summer (#2350) 2025-08-22 13:14:41 +00:00
timers.inc Allow void return type in timer callbacks (#1916) 2023-03-02 21:28:42 -08:00
topmenus.inc Documentation corrections and additions (#1498) 2021-06-24 15:45:01 +01:00
usermessages.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
vector.inc Correct Plugin API Documentation Formatting (#1019) 2019-05-28 18:38:58 -07:00
version.inc Bump version 2024-10-20 12:57:26 -04:00
version.tpl Mirrored buildbot/version template changes from branch. 2008-09-14 06:13:25 +00:00
virtual_address.inc Introduce Virtual Address (#2226) 2025-11-13 13:23:13 +01:00