[PR #546] xmem: wire executable __XMemAllocationHooks__ export into XMemAlloc/X… #591

Open
opened 2026-11-26 20:18:24 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/546
Author: @kotekompotek
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: work/xmem-allocation-hooks


📝 Commits (1)

  • 8c3eb18 xmem: forward XMemAlloc/XMemFree through the title's XMemAllocationHooks

📊 Changes

3 files changed (+71 additions, -1 deletions)

View changed files

📝 docs/xmem_exe_calls.md (+5 -1)
📝 runtime/shims/xmem.cpp (+10 -0)
📝 runtime/test/xmem_test.cpp (+56 -0)

📄 Description

Claimed in the coordination issue as: XMEM-HOOKS (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7140854018)

What and why

  • Rebased onto current main.
  • Wired an executable's exported __XMemAllocationHooks__ ({alloc, free}) through pe_loader / shims into XMemAlloc/XMemFree (while XMemAllocDefault/XMemFreeDefault bypass hooks and Loader::~Loader() clears them).
  • Updated runtime/shims/xmem.h comment and docs/xmem_exe_calls.md to accurately reflect that only the symbol export is observed in docs/xmem_exe_calls.md and title runtime hook behaviour is unmeasured.

Tested

  • Built and ran CTest targets pe_loader (Passed, 1.80s) and xmem (Passed, 0.27s) on Windows.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/546 **Author:** [@kotekompotek](https://github.com/kotekompotek) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `work/xmem-allocation-hooks` --- ### 📝 Commits (1) - [`8c3eb18`](https://github.com/ubiquitarianism/leonida/commit/8c3eb18264df7d004c43a9e467ac9e71725bbb34) xmem: forward XMemAlloc/XMemFree through the title's __XMemAllocationHooks__ ### 📊 Changes **3 files changed** (+71 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/xmem_exe_calls.md` (+5 -1) 📝 `runtime/shims/xmem.cpp` (+10 -0) 📝 `runtime/test/xmem_test.cpp` (+56 -0) </details> ### 📄 Description Claimed in the coordination issue as: XMEM-HOOKS (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7140854018) ### What and why - Rebased onto current `main`. - Wired an executable's exported `__XMemAllocationHooks__` (`{alloc, free}`) through `pe_loader` / `shims` into `XMemAlloc`/`XMemFree` (while `XMemAllocDefault`/`XMemFreeDefault` bypass hooks and `Loader::~Loader()` clears them). - Updated `runtime/shims/xmem.h` comment and `docs/xmem_exe_calls.md` to accurately reflect that only the symbol export is observed in `docs/xmem_exe_calls.md` and title runtime hook behaviour is unmeasured. ### Tested - Built and ran CTest targets `pe_loader` (`Passed`, 1.80s) and `xmem` (`Passed`, 0.27s) on Windows. GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#591
No description provided.