sourcemod/plugins
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-flatfile Fix admin-flatfile.sp includes (#2043) 2023-09-13 18:28:35 +02:00
adminmenu Add missing return values in plugins 2021-08-21 14:11:20 -07:00
basebans Add missing return values in plugins 2021-08-21 14:11:20 -07:00
basecomm Add missing return values in plugins 2021-08-21 14:11:20 -07:00
basecommands fix: Print full map name in Log instead of args (#1907) 2023-01-15 13:32:41 -05:00
basevotes Prevent enum shadowing & pin sourcemod for build fixes (#1661) 2021-12-10 14:22:04 -08:00
funcommands Add GetCmdArgFloat(Ex) stocks (#1742) 2022-04-12 11:17:05 +01:00
funvotes Add missing return values in plugins 2021-08-21 14:11:20 -07:00
include Introduce Virtual Address (#2226) 2025-11-13 13:23:13 +01:00
playercommands Add missing return values in plugins 2021-08-21 14:11:20 -07:00
testsuite Add new options to ArrayList FindString, FindValue (#2216) 2025-11-08 17:03:42 +00:00
admin-flatfile.sp Fix admin-flatfile.sp includes (#2043) 2023-09-13 18:28:35 +02:00
admin-sql-prefetch.sp Update small plugins for transitional syntax (#506) 2016-05-11 09:32:34 -04:00
admin-sql-threaded.sp Related to #2148: (#2270) 2025-02-20 04:27:53 +00:00
adminhelp.sp Add CommandIterator.ConVarFlags property (#1869) 2022-12-04 12:24:56 +01:00
adminmenu.sp Add missing in-game check in adminmenu 2025-06-01 13:54:41 -04:00
AMBuilder Fix admin-flatfile.sp includes (#2043) 2023-09-13 18:28:35 +02:00
antiflood.sp Introduce enum structs to core sm plugins 2018-12-15 13:51:03 -08:00
basebans.sp Ignore chat triggers for interactive ban reason (#2067) 2023-10-16 19:43:00 +02:00
basechat.sp Add "sm_dsay" command to basechat for sending HUD messages (#1889) 2022-12-20 00:00:43 +00:00
basecomm.sp Fix basecomm failing to load on games without sv_alltalk (#1212) 2020-03-11 21:24:16 -07:00
basecommands.sp Prevent basecommands from printing to disconnected clients (#1138) 2020-02-06 22:32:16 -08:00
basetriggers.sp Update basetriggers.sp for Dystopia compatibility (#2075) 2023-11-06 16:10:46 +00:00
basevotes.sp Add logging to all basevote vote results (#1794) 2022-10-30 23:26:17 +01:00
clientprefs.sp cookies: Align output with sm_help (#977) 2020-07-08 20:38:35 -07:00
compile.sh Add spacing to compile.sh (#53) 2016-10-24 14:50:24 +01:00
funcommands.sp Add missing return values in plugins 2021-08-21 14:11:20 -07:00
funvotes.sp Allow h-flag admins to bypass vote delay (#1733) 2022-04-12 11:19:54 +01:00
mapchooser.sp Update to the new SourcePawn compiler. 2021-10-26 17:45:48 -10:00
nextmap.sp Clear sm_nextmap so we don't get stuck in a loop (#1545) 2023-07-03 20:48:01 +02:00
nominations.sp nominations: implement map not in pool phrase (#597) 2023-03-29 18:39:54 -07:00
playercommands.sp Update small plugins for transitional syntax (#506) 2016-05-11 09:32:34 -04:00
randomcycle.sp Prevent duplicate map changes in randomcycle.sp (#1428) 2021-03-14 01:02:42 -08:00
reservedslots.sp Fixed typo in reservedslots.sp (#2109) 2024-02-01 10:36:28 +01:00
rockthevote.sp Add missing return values in plugins 2021-08-21 14:11:20 -07:00
sounds.sp Prevent commands from being run on the client with sm_play (#1832) 2023-09-27 16:51:07 +02:00
sql-admin-manager.sp Add PostgreSQL database driver (#32) 2021-03-11 11:21:51 +01:00