SourceMod - Source Engine Scripting and Administration
Go to file
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
.github Update Python version from 3.8 to 3.12 (#2375) 2025-11-07 15:30:17 +00:00
bridge/include Fix gamedata gamebin paths for x64, CS:GO-based games (#2370) (#2374) 2025-11-07 15:30:46 +00:00
configs Make PostgreSQL setup scripts idempotent (#2376) 2025-11-10 15:39:08 +00:00
core Introduce Virtual Address (#2226) 2025-11-13 13:23:13 +01:00
editor Updated sourcepawn.php to latest array syntax 2023-11-30 21:58:49 -08:00
extensions Introduce Virtual Address (#2226) 2025-11-13 13:23:13 +01:00
gamedata Update ZPS Gamedata (#2371) 2025-10-30 23:23:46 +01:00
hl2sdk-manifests@c018a99447 Update hl2sdk-manifests 2025-11-08 11:42:34 -05:00
licenses Fix quote mismatch (#1092) 2019-09-30 22:43:18 -07:00
loader Add support for Military Conflict: Vietnam (#1887) 2022-12-20 21:46:18 +00:00
plugins Introduce Virtual Address (#2226) 2025-11-13 13:23:13 +01:00
public Fix issues with -fPIC thunks (#2366) 2025-10-26 17:33:38 +01:00
sourcepawn@11b22edb63 Fix/add LookupAttachment gamedata for cstrike/dod/hl2mp (fixes #2337) 2025-06-21 16:09:51 -04:00
tools Fix/add LookupAttachment gamedata for cstrike/dod/hl2mp (fixes #2337) 2025-06-21 16:09:51 -04:00
translations Korean translation 250731 (#2345) 2025-08-15 20:25:35 +02:00
versionlib Update to AMBuild 2.2. 2020-08-18 23:09:43 -07:00
.arcconfig Add a .arcconfig file so that arc works 2013-10-15 22:57:59 +01:00
.gitattributes NPOTB: Correct GitHub's Linguist inaccuracies (#1096) 2019-10-07 19:14:09 +01:00
.gitignore Convert AMBuild scripts to use hl2sdk-manifests (#2096) 2023-12-18 23:15:44 +00:00
.gitmodules Introduce Virtual Address (#2226) 2025-11-13 13:23:13 +01:00
.travis.yml Prefer python3 over python(2) in checkout-deps (#1424) 2021-03-07 13:50:15 +01:00
AMBuildScript Manifest updates and compilation fixes for css, tf2, dods, hl2dm (#2268) 2025-02-20 00:51:38 +00:00
appveyor.yml Add support for hl2sdk-mock. 2021-09-22 12:36:44 -07:00
changelog.txt Triggering a build. 2011-04-13 19:05:41 -05:00
configure.py Add support for ASAN. 2021-11-11 23:41:42 -08:00
product.version Bump version 2024-10-20 12:57:26 -04:00
pushbuild.txt Push build for safetyhook submodule update (#2347) 2025-08-09 05:49:18 +02:00
README.md Bring languages into the tree (#1625) 2023-03-29 16:23:05 +02:00

SourceMod

General

Development

Contact

  • Connect with us on GameSurge IRC in #sourcemod
  • Alternatively feel free to join our Discord server

License

SourceMod is licensed under the GNU General Public License version 3. Special exceptions are outlined in the LICENSE.txt file inside of the licenses folder.