Skip to content

Reconcile with the new SourcePawn API#2460

Open
dvander wants to merge 4 commits into
masterfrom
base-runtime
Open

Reconcile with the new SourcePawn API#2460
dvander wants to merge 4 commits into
masterfrom
base-runtime

Conversation

@dvander
Copy link
Copy Markdown
Member

@dvander dvander commented May 17, 2026

This updates the SourcePawn library, which breaks binary compatibility for extensions (not for plugins) due to many changes to the public API.

The most significant change is that ICallable is removed. Instead, arguments are now packed into a CallArgs structure which is then passed to the VM. CallArgs is much more efficient than the old ICallable::Push API, reducing invocation overhead by about 15% on my computer. functions.inc now uses CallArgs internally, and IForwardSys has been augmented to use CallArgs as well.

Extensions do need to be recompiled. However, the old "Push" API is retained for source-level compatibility, which is why almost no first-party extensions were changed in this PR. Well-behaving extensions will recompile with no issues.

Some extremely esoteric features were removed, so extensions using them will no longer work.

  • IForwardSys no longer supports variadic functions. This feature had no use in the corpus or internally, and was almost impossible to actually use in any meaningful way.
  • An IPluginContext function specifically to make VFormat() work is now restricted to core.
  • Any function in sp_vm_api.h that was not used by SourceMod's first-party extensions has been removed from the public API. These should generally have never been used, and were mostly related to native binding or named function lookup (which should be done via ForwardSys or GetFunctionById).

dvander added 4 commits May 14, 2026 21:26
Also remove ISourcePawnEngine and ISourcePawnEngine2 pointers since
they're now redundant.
This removes a ton of tech debt and will improve Forward performance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant