Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mi_is_redirected method not found #993

Open
ovaar opened this issue Jan 22, 2025 · 2 comments
Open

mi_is_redirected method not found #993

ovaar opened this issue Jan 22, 2025 · 2 comments

Comments

@ovaar
Copy link

ovaar commented Jan 22, 2025

version: mimalloc/1.8.9
os: Windows

After the completion of #869, see aa88173#diff-4eea39c9329dca2c31253a2770771a90ad6d20bb76241d71cb78d68a9291d337L521, the function implementation of mi_is_redirected was removed.

Though the function is still listed in mimalloc.h, resulting in a link error. I tried patching it using the patch as described below, without luck resulting in a runtime error 0xC0000139: Entry Point Not Found.

From 0fce210f707fe12890877d381fd25af6e73b9eea Mon Sep 17 00:00:00 2001
From: Thomas Reynders 
Date: Wed, 22 Jan 2025 13:50:05 +0100
Subject: [PATCH] patch(mimalloc): Restore declspec export for mi_is_redirected

- Create proxy function which exports the internal _mi_is_redirected through mi_is_redirected
---
 src/init.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/init.c b/src/init.c
index 734bf5d..a25fa06 100644
--- a/src/init.c
+++ b/src/init.c
@@ -558,6 +558,10 @@ bool mi_decl_noinline _mi_preloading(void) {
   return os_preloading;
 }
 
+mi_decl_nodiscard bool mi_is_redirected(void) mi_attr_noexcept {
+  return _mi_is_redirected();
+}
+
 // Called once by the process loader from `src/prim/prim.c`
 void _mi_process_load(void) {
   mi_heap_main_init();
-- 
2.47.1.windows.1
@ovaar
Copy link
Author

ovaar commented Jan 22, 2025

Edit:

Though the function is still listed in mimalloc.h, resulting in a link error. I tried patching it using the patch as described below, without luck resulting in a runtime error 0xC0000139: Entry Point Not Found.

This part was on me and is not an issue with mimalloc

daanx added a commit that referenced this issue Feb 11, 2025
@daanx
Copy link
Collaborator

daanx commented Feb 11, 2025

Thanks so much for spotting this! Should be fixed now.

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

No branches or pull requests

2 participants