sourcemod/core/logic
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
..
libaddrz@661cd316e6 Introduce Virtual Address (#2226) 2025-11-13 13:23:13 +01:00
AdminCache.cpp Fix sm_dump_admcache with command group overrides (#1519) 2021-07-01 22:19:50 +01:00
AdminCache.h Add IntMap methodmap (#2018) 2024-10-31 23:35:41 +00:00
ADTFactory.cpp Move ADTFactory from core to logic (bug 5953, r=fyren). 2013-10-09 08:43:08 -04:00
ADTFactory.h Add IntMap methodmap (#2018) 2024-10-31 23:35:41 +00:00
AMBuilder Introduce Virtual Address (#2226) 2025-11-13 13:23:13 +01:00
BaseWorker.cpp Start using Github Actions (#1488) 2021-05-09 01:46:08 +02:00
BaseWorker.h Pare down ThreadSupport and remove ancient thread code. 2020-05-13 00:35:29 -07:00
CDataPack.cpp Fix out of bounds write in CDataPack::Write*Array (#1554) 2021-07-28 22:19:16 +01:00
CDataPack.h datapack: remove legacy cache (#1357) 2020-10-02 16:04:30 -07:00
CellArray.h Fix crash when ArrayList runs out of memory (#1235) 2020-04-30 17:59:54 +01:00
common_logic.cpp Introduce Virtual Address (#2226) 2025-11-13 13:23:13 +01:00
common_logic.h Manifest updates and compilation fixes for css, tf2, dods, hl2dm (#2268) 2025-02-20 00:51:38 +00:00
Database.cpp Lift raw pointers out of DatabaseConfBuilder (#1637) 2022-05-24 11:41:15 +02:00
Database.h Lift raw pointers out of DatabaseConfBuilder (#1637) 2022-05-24 11:41:15 +02:00
DatabaseConfBuilder.cpp Lift raw pointers out of DatabaseConfBuilder (#1637) 2022-05-24 11:41:15 +02:00
DatabaseConfBuilder.h Lift raw pointers out of DatabaseConfBuilder (#1637) 2022-05-24 11:41:15 +02:00
DebugReporter.cpp Fix ClientPrefs pointer string formatting (#2307) 2025-03-31 21:21:54 +00:00
DebugReporter.h Fix vote menu handler to work with direct arrays. 2021-12-09 18:10:35 -08:00
ExtensionSys.cpp CDetour safetyhook (#2162) 2024-05-21 01:53:44 +00:00
ExtensionSys.h Only show extensions that failed to load if the extension is required. 2017-11-30 12:57:12 -05:00
ForwardSys.cpp Replace ke::LinkedList with std::list. 2020-05-31 23:19:41 -07:00
ForwardSys.h Don't break backwards compatibility with unmanaged forwards 2017-08-25 23:23:50 +02:00
frame_tasks.cpp Replace ke::Vector with std::vector. 2020-05-31 11:35:51 -07:00
frame_tasks.h Rename ke::Lambda to ke::Function. 2020-05-17 12:33:52 -07:00
FrameIterator.cpp Replace ke::Vector with std::vector. 2020-05-31 11:35:51 -07:00
FrameIterator.h Fix crash in FrameIterator. 2021-07-16 18:33:10 -07:00
GameConfigs.cpp Fix gamedata gamebin paths for x64, CS:GO-based games (#2370) (#2374) 2025-11-07 15:30:46 +00:00
GameConfigs.h Add IntMap methodmap (#2018) 2024-10-31 23:35:41 +00:00
handle_helpers.h Split intercom.h into separate headers and reduce shared header inclusion. 2015-08-31 10:00:49 -07:00
HandleSys.cpp Bump handle limit to 1MB. 2021-10-26 07:05:34 -10:00
HandleSys.h Bump handle limit to 1MB. 2021-10-26 07:05:34 -10:00
LibrarySys.cpp Migrate extensions to common AMTL string funcs (#785) 2018-03-25 13:00:53 -07:00
LibrarySys.h Update to the latest AMTL - Rename Ref to RefPtr. 2015-11-08 13:14:57 -08:00
Logger.cpp Allow the time format used by SM log files to be configured by server ops. (#2372) 2025-11-08 17:08:32 +00:00
Logger.h Allow the time format used by SM log files to be configured by server ops. (#2372) 2025-11-08 17:08:32 +00:00
LumpManager.cpp entitylump: Output separator as spaces instead of tabs (#1873) 2022-12-05 13:14:54 +01:00
LumpManager.h Add functions for working with entity lumps (#1673) 2022-09-05 15:44:58 -07:00
MemoryUtils.cpp Manifest updates and compilation fixes for css, tf2, dods, hl2dm (#2268) 2025-02-20 00:51:38 +00:00
MemoryUtils.h Cache copy of library on first symbol/signature lookup (#1642) 2021-11-18 17:55:32 +01:00
MersenneTwister.h Added better random number generator (bug 3831, r=fyren). 2009-10-26 23:59:59 -07:00
Native.h Add IntMap methodmap (#2018) 2024-10-31 23:35:41 +00:00
NativeOwner.cpp Replace ke::Vector with std::vector. 2020-05-31 11:35:51 -07:00
NativeOwner.h Replace ke::LinkedList with std::list. 2020-05-31 23:19:41 -07:00
PhraseCollection.cpp Add Translation Natives (#669) 2017-11-20 21:24:01 -08:00
PhraseCollection.h Add Translation Natives (#669) 2017-11-20 21:24:01 -08:00
PluginSys.cpp Introduce Virtual Address (#2226) 2025-11-13 13:23:13 +01:00
PluginSys.h Add IntMap methodmap (#2018) 2024-10-31 23:35:41 +00:00
ProfileTools.cpp Replace ke::Vector with std::vector. 2020-05-31 11:35:51 -07:00
ProfileTools.h Replace ke::Vector with std::vector. 2020-05-31 11:35:51 -07:00
PseudoAddrManager.cpp Introduce Virtual Address (#2226) 2025-11-13 13:23:13 +01:00
PseudoAddrManager.h Introduce Virtual Address (#2226) 2025-11-13 13:23:13 +01:00
RootConsoleMenu.cpp Update credits (#1367) 2020-10-16 21:41:21 +01:00
RootConsoleMenu.h Individualize NameHashSet Hashing & Revisit #709 (#740) 2018-07-10 17:38:40 -04:00
ShareSys.cpp sourcepawn: uplift FakeNative to DynamicNative. (#1338) 2020-10-02 16:42:31 -07:00
ShareSys.h Add IntMap methodmap (#2018) 2024-10-31 23:35:41 +00:00
sm_crc32.cpp Invert CRC to match most popular implementations. 2021-11-01 13:04:23 -04:00
sm_crc32.h Mercurial queues... oh, how terrible. 2010-01-18 03:20:44 -08:00
sm_simple_prioqueue.h Move DBManager and DB natives from core to logic (bug 5953, r=fyren). 2013-10-09 08:43:08 -04:00
sm_symtable.h Move memutils from core to logic (bug 4406, r=ds). 2010-05-14 16:14:59 -07:00
sm_trie.cpp Move adminsys and more natives from core to logic. 2014-05-29 13:31:12 -04:00
sm_trie.h Move adminsys and more natives from core to logic. 2014-05-29 13:31:12 -04:00
smn_admin.cpp Purge Purge. 2015-03-05 10:56:36 -08:00
smn_adt_array.cpp Add new options to ArrayList FindString, FindValue (#2216) 2025-11-08 17:03:42 +00:00
smn_adt_stack.cpp Add more functions to ArrayStack (#2019) 2023-09-27 15:43:04 +02:00
smn_adt_trie.cpp Add IntMap methodmap (#2018) 2024-10-31 23:35:41 +00:00
smn_banning.cpp Split intercom.h into separate headers and reduce shared header inclusion. 2015-08-31 10:00:49 -07:00
smn_console.cpp core: Call SetGlobalTarget in PrintToConsole (#1448) 2021-03-20 22:24:06 -07:00
smn_core.cpp Introduce Virtual Address (#2226) 2025-11-13 13:23:13 +01:00
smn_database.cpp Update SourcePawn. 2023-11-02 18:38:30 -10:00
smn_datapacks.cpp Handle INVALID_FUNCTION mismatches at plugin boundaries, redux (#2136) 2024-04-19 21:56:48 -04:00
smn_entitylump.cpp Add functions for working with entity lumps (#1673) 2022-09-05 15:44:58 -07:00
smn_entitylump.h Add functions for working with entity lumps (#1673) 2022-09-05 15:44:58 -07:00
smn_fakenatives.cpp Handle INVALID_FUNCTION mismatches at plugin boundaries, redux (#2136) 2024-04-19 21:56:48 -04:00
smn_filesystem.cpp Add GetFilePermissions (#2177) 2024-06-08 14:17:50 +00:00
smn_float.cpp Update SourcePawn. 2023-11-03 17:46:48 -10:00
smn_functions.cpp Handle INVALID_FUNCTION mismatches at plugin boundaries, redux (#2136) 2024-04-19 21:56:48 -04:00
smn_gameconfigs.cpp Introduce Virtual Address (#2226) 2025-11-13 13:23:13 +01:00
smn_halflife.cpp Add support for retrieving game server Steam Id (bug 6404). (#495) 2016-04-26 23:17:08 -04:00
smn_handles.cpp Add Clone to Handle methodmap 2024-10-19 13:20:20 -04:00
smn_lang.cpp Add GetClientOriginalLanguage (#1810) 2022-07-28 18:10:51 -07:00
smn_maplists.cpp Fix ReadMapList ignoring file's last modified time (#1891) 2022-12-20 21:26:57 +00:00
smn_menus.cpp Update SourcePawn. 2023-11-02 18:38:30 -10:00
smn_players.cpp Revert "Merge branch '👺'" 2024-07-27 10:17:57 -04:00
smn_profiler.cpp Add Profiler methodmap (#814) 2018-07-08 11:05:29 -04:00
smn_sorting.cpp Update to the new SourcePawn compiler. 2021-10-26 17:45:48 -10:00
smn_string.cpp Fix Int64ToString producing incorrect output (#1723) 2022-03-04 03:03:35 -08:00
smn_textparse.cpp Add SMCParser.ParseString (#1817) 2022-12-02 16:55:08 +01:00
smn_timers.cpp Split intercom.h into separate headers and reduce shared header inclusion. 2015-08-31 10:00:49 -07:00
sprintf.cpp Add format specifier "%E" (#2099) (#2330) 2025-11-08 17:09:57 +00:00
sprintf.h Implement an auto-escaping Format native for SQL query construction 2016-02-15 15:05:16 +00:00
stringutil.cpp Fix Miscellaneous Regressions and UBs (#1022) 2019-05-28 18:04:08 -07:00
stringutil.h Move the guts of Format to a helper function 2016-02-15 12:49:22 +00:00
TextParsers.cpp fix parsing crash (#2173) 2024-06-09 17:13:32 +00:00
TextParsers.h Import of core modularization plan (bug 3599). 2009-05-13 21:55:50 -04:00
ThreadSupport.cpp Fix crash when creating threads with Thread_AutoRelease 2021-03-11 09:48:39 +01:00
ThreadSupport.h Replace all uses of AMTL threads with STL threads. 2020-05-16 22:35:56 -07:00
Translator.cpp Replace ke::SafeSprintf with ke::SafeStrcpy (#784) 2018-03-19 20:12:51 +00:00
Translator.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