sourcemod/core
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
..
logic Introduce Virtual Address (#2226) 2025-11-13 13:23:13 +01:00
AMBuilder Convert AMBuild scripts to use hl2sdk-manifests (#2096) 2023-12-18 23:15:44 +00:00
CellRecipientFilter.h Remove support for Source 1 Dota 2. (#496) 2016-04-26 23:18:47 -04:00
ChatTriggers.cpp Add natives to get chat triggers (#1816) 2022-12-02 13:55:32 +01:00
ChatTriggers.h Add natives to get chat triggers (#1816) 2022-12-02 13:55:32 +01:00
command_args.h Move CCommandArgs into its own header. 2015-08-31 00:07:37 -07:00
concmd_cleaner.cpp Add support for Military Conflict: Vietnam (#1887) 2022-12-20 21:46:18 +00:00
concmd_cleaner.h Remove bad-console-read protection logic for Metamod:Source 1.7 and earlier. 2015-09-09 18:59:31 -07:00
ConCmdManager.cpp Make all command lookups case-insensitive (#1542) 2021-07-18 19:05:06 +01:00
ConCmdManager.h Add IntMap methodmap (#2018) 2024-10-31 23:35:41 +00:00
ConCommandBaseIterator.h Added support for Alien Swarm (bug 4530, r=dvander). 2010-07-27 17:32:32 -05:00
ConsoleDetours.cpp Update AMTL; replace AutoPtr/UniquePtr with STL. 2020-05-18 18:19:16 -07:00
ConsoleDetours.h Add IntMap methodmap (#2018) 2024-10-31 23:35:41 +00:00
ConVarManager.cpp Track the creating plugin for convars (#1537) 2021-07-18 17:19:27 +01:00
ConVarManager.h Add IntMap methodmap (#2018) 2024-10-31 23:35:41 +00:00
CoreConfig.cpp Replace AString with std::string. 2020-05-20 17:57:18 -07:00
CoreConfig.h Add IntMap methodmap (#2018) 2024-10-31 23:35:41 +00:00
EventManager.cpp Replace AString with std::string. 2020-05-20 17:57:18 -07:00
EventManager.h Replace AString with std::string. 2020-05-20 17:57:18 -07:00
frame_hooks.cpp Move DBManager and DB natives from core to logic (bug 5953, r=fyren). 2013-10-09 08:43:08 -04:00
frame_hooks.h Initial import of updater extension, currently incomplete - just getting it in the tree (bug 3530). 2009-02-02 15:41:25 -05:00
GameHooks.cpp Add support for Military Conflict: Vietnam (#1887) 2022-12-20 21:46:18 +00:00
GameHooks.h Replace ke::Vector with std::vector. 2020-05-31 11:35:51 -07:00
HalfLife2.cpp Fix NULL Crash on ReferenceToIndex (#2311) 2025-04-25 17:52:44 +00:00
HalfLife2.h Add extension methods for clearing netprop & datamaps cache (#1943) 2025-04-07 15:26:09 +02:00
Logger.cpp Split intercom.h into separate headers and reduce shared header inclusion. 2015-08-31 10:00:49 -07:00
Logger.h Move Logger and Core natives to Logic 2014-08-13 14:24:35 -07:00
logic_bridge.cpp Fix up GetGameBinArchSubdirectory 2025-11-08 11:26:03 -05:00
logic_bridge.h Split intercom.h into separate headers and reduce shared header inclusion. 2015-08-31 10:00:49 -07:00
MenuManager.cpp Move menu sound selection from core config to gamedata. (#1896) 2022-12-29 04:10:51 +00:00
MenuManager.h Move menu sound selection from core config to gamedata. (#1896) 2022-12-29 04:10:51 +00:00
MenuStyle_Base.cpp Allow sending panels to SourceTV client via settings (#2239) 2024-12-30 20:16:25 +00:00
MenuStyle_Base.h menusys: add MenuShufflePerClient native (#1073) 2020-08-06 20:31:00 -07:00
MenuStyle_Radio.cpp Add missing null pointer check to protobuf messages (#1883) 2022-12-20 21:50:57 +00:00
MenuStyle_Radio.h Move menu sound selection from core config to gamedata. (#1896) 2022-12-29 04:10:51 +00:00
MenuStyle_Valve.cpp Remove support for Source 1 Dota 2. (#496) 2016-04-26 23:18:47 -04:00
MenuStyle_Valve.h Root Menu Handles during Display. 2015-02-21 17:10:26 -08:00
MenuVoting.cpp Fix crash when selecting a vote item that contains a format specifier (#2323) 2025-05-30 00:10:51 -07:00
MenuVoting.h Added voting output (bug 1997, r=dvander) 2009-09-17 18:54:40 +12:00
NextMap.cpp Clear sm_nextmap so we don't get stuck in a loop (#1545) 2023-07-03 20:48:01 +02:00
NextMap.h Increase lastMap buffer (#2062) 2023-10-17 12:31:04 +02:00
PlayerManager.cpp Add OnServerHibernationUpdate forward (closes #1483) (#2151) 2024-05-07 01:44:56 +00:00
PlayerManager.h Add support for Military Conflict: Vietnam (#1887) 2022-12-20 21:46:18 +00:00
provider.h fix: Allow entity references for clients with L and N format specifiers (#2244) 2025-01-16 00:57:46 +00:00
sm_autonatives.cpp Move scared guts of core into logic (bug 5680, r=fyren). 2013-03-29 11:37:29 -07:00
sm_autonatives.h Move scared guts of core into logic (bug 5680, r=fyren). 2013-03-29 11:37:29 -07:00
sm_convar.h Out with the old ConVar accessibility hacks, in with the new. 2018-05-06 12:59:33 -04:00
sm_fastlink.h Added detection for clang compiler and fixed various warnings triggered by it (bug 4878, r=dvander). 2011-04-23 21:53:53 -05:00
sm_globals.h Add support for retrieving game server Steam Id (bug 6404). (#495) 2016-04-26 23:17:08 -04:00
sm_memtable.h Refactor Trie natives to use HashMap instead of KTrie; add iteration API (bug 5892, r=ds). 2013-08-29 10:09:02 -07:00
sm_stringutil.cpp Remove blanket includes from sm_stringutil. 2015-09-09 15:18:24 -07:00
sm_stringutil.h Remove blanket includes from sm_stringutil. 2015-09-09 15:18:24 -07:00
smn_bitbuffer.cpp Implement a new stack and error handling model for the SourcePawn VM. 2015-03-04 23:45:30 -08:00
smn_commandline.cpp Fix default value always being when calling ParmValue(string,string). 2017-04-22 21:28:44 -04:00
smn_console.cpp Prevent recursion in sm_ServerCommandEx (fixes #967) (#2133) 2024-04-18 11:42:37 +00:00
smn_entities.cpp Introduce Virtual Address (#2226) 2025-11-13 13:23:13 +01:00
smn_events.cpp Add getter for Event.BroadcastDisabled (#946) 2019-01-03 19:42:42 +00:00
smn_halflife.cpp Add support for Military Conflict: Vietnam (#1887) 2022-12-20 21:46:18 +00:00
smn_hudtext.cpp Add missing null pointer check to protobuf messages (#1883) 2022-12-20 21:50:57 +00:00
smn_keyvalues.cpp Make KeyValues.Rewind traversal-stack clearing optional (#1993) 2023-04-17 13:10:02 +01:00
smn_keyvalues.h Add KeyValues.ExportToString (#706) 2017-10-28 12:47:00 +01:00
smn_nextmap.cpp - Added ForceChangeLevel and Map History to nextmap api 2008-07-13 05:13:37 +00:00
smn_player.cpp Move adminsys and more natives from core to logic. 2014-05-29 13:31:12 -04:00
smn_protobuf.cpp pb: Add natives to work with 64 bit values (#943) 2019-03-04 09:06:43 -08:00
smn_usermsgs.cpp Remove support for Source 1 Dota 2. (#496) 2016-04-26 23:18:47 -04:00
smn_usermsgs.h Added initial support for protobuf usermessages on CS:GO (bug 5579, r=asherkin). 2013-01-22 21:43:12 -05:00
smn_vector.cpp Added preliminary support for Left 4 Dead; some things may not yet work. 2008-11-14 09:18:30 -06:00
sourcemm_api.cpp Split PVKII into its own engine branch (#1847) 2022-10-24 19:27:32 +00:00
sourcemm_api.h Out with the old ConVar accessibility hacks, in with the new. 2018-05-06 12:59:33 -04:00
sourcemod.cpp Manifest updates and compilation fixes for css, tf2, dods, hl2dm (#2268) 2025-02-20 00:51:38 +00:00
sourcemod.h Add functions for working with entity lumps (#1673) 2022-09-05 15:44:58 -07:00
TimerSys.cpp Revert "Switch internal SM concept of frames to use Think (#1540)" (#1572) 2021-08-25 19:59:57 +01:00
TimerSys.h Revert "Switch internal SM concept of frames to use Think (#1540)" (#1572) 2021-08-25 19:59:57 +01:00
UserMessagePBHelpers.h Add support for Military Conflict: Vietnam (#1887) 2022-12-20 21:46:18 +00:00
UserMessages.cpp Add support for Military Conflict: Vietnam (#1887) 2022-12-20 21:46:18 +00:00
UserMessages.h Add IntMap methodmap (#2018) 2024-10-31 23:35:41 +00:00
version.rc Overhauled versioning information (bug 5453, r=dvander). 2012-08-26 01:33:54 +01:00
vprof_tool.cpp Build tier1 & mathlib (#2368) 2025-11-08 16:47:35 +00:00
vprof_tool.h Fix vprof crashing in some games (#1541) 2021-07-18 19:08:36 +01:00