Repository navigation
Conversation
MRMesh links the same shared mimalloc as the executables, so bit sets get mimalloc even where malloc is not redirected; Emscripten keeps std::allocator. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mrbind drops custom allocators, so the generated C bindings passed a plain std::vector to fromBlocks. mimalloc.h now comes in through MRBitSet.h, which clashed with the test's own noexcept-less declarations on MSVC. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Consumers that link only MRMesh by name (the C++ examples, Windows distribution users) failed with unresolved __imp_mi_free. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o bitset-mimalloc
MeshLib libraries link a non-override mimalloc (dlopen-safe thread-locals on Linux), so mrmeshpy and other bindings load into any process; a malloc- overriding libmimalloc loaded late crashed Python on Linux and macOS. MRTest and MeshViewer keep the system allocator. An application sets MR_MIMALLOC_OVERRIDE=ON: on macOS and Linux MeshLib then builds its own override copy (mimalloc-override) shared by the libraries and mr_enable_mimalloc executables; Windows keeps vcpkg's mimalloc[override], whose redirect engages only in mr_enable_mimalloc executables. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MeshLib libraries link a non-override mimalloc (dlopen-safe thread-locals on Linux), so mrmeshpy and other bindings load into any process; a malloc- overriding libmimalloc loaded late crashed Python on Linux and macOS. MRTest and MeshViewer keep the system allocator. An application sets MR_MIMALLOC_OVERRIDE=ON: on macOS and Linux MeshLib then builds its own override copy (mimalloc-override) shared by the libraries and mr_enable_mimalloc executables; Windows keeps vcpkg's mimalloc[override], whose redirect engages only in mr_enable_mimalloc executables. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
McpGateway reuses MRPch's precompiled header, which carried the pragma, without linking mimalloc: LNK1104 on mimalloc-debug.dll.lib in Debug. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…MakeLists.txt They do not run CPM stage1, so find_package(mimalloc) found nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MeshInspector's AppImage could not find libmimalloc-override.so.3: the fetched target was built but not installed with the application. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MeshInspector's start-and-exit test spawns a plain python3 that imports the Python modules of the MeshInspector build, which link libmimalloc-override: it segfaulted on import. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its own CMake config, copied into distributions with the thirdparty libs, points at a non-existent lib/MeshLib/include. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On macOS mimalloc turns MI_LOCAL_DYNAMIC_TLS into -ftls-model=local-dynamic, and MeshInspector's MRTest then aborted in dyld at launch on macOS 13 arm64. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…efore Applications overriding malloc (MeshInspector) build MeshLib exactly as on master: BitSet uses std::allocator, MeshLib libraries do not link mimalloc, and only mr_enable_mimalloc executables get the override build. So plain Python can still import such builds' modules (it segfaulted on Rocky Linux 8 with libmimalloc-override linked into them). Drops the local-dynamic TLS of the override build, which did not help. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
They do not include config_cmake.h, so in MeshInspector builds mrmeshpy compiled BitSet with mi_stl_allocator against an MRMesh using std::allocator: "symbol not found in flat namespace '_mi_new_n'" on macOS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MeshInspector's macOS Debug (Homebrew) start-and-exit test hung at exit, twice; master uses Homebrew's release-built mimalloc there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mimalloc's CMake passes MI_DEBUG=2, MI_GUARDED=2 and MI_STATS=2 explicitly for a Debug build type, so the define did not change anything. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-override MRMimalloc The dependency trees (CPM, vcpkg, Homebrew) are back to master's malloc- overriding mimalloc, and with MR_MIMALLOC_OVERRIDE (MeshInspector) MRTest and MeshViewer override malloc again, as on master. Only MeshLib's own builds differ: their libraries allocate BitSet blocks with a non-override mimalloc of the same version that MeshLib builds itself on macOS and Linux, named MRMimalloc so it does not collide with the dependencies' libmimalloc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fetched mimalloc compiled against Homebrew's 3.5.1 headers from the global include_directories, and its mi_stl_allocator failed the C bindings' -Werror -Wdeprecated-copy through a non-system -I. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The generated targets file rejects referenced imported targets that do not
exist yet ("referenced, but are missing: mimalloc"); MRMimalloc is found in
MR_MAIN_LIB_DIR instead of next to the imported MRMesh.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The vcpkg tarball keeps thirdparty headers in the top-level include/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…b dir In the extracted .deb, MRMesh's PACKAGE_MR_MAIN_LIB_DIR is the absolute /usr/local/lib/MeshLib, while meshlib-config.cmake's directories relocate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BitSet::Blocks is now simply std::vector<block_type, Allocator<block_type>>. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- generate.mk no longer links mimalloc for the Windows bindings: MRAllocator.h auto-links it on MSVC outside MeshLib's CMake builds. - MRMimalloc builds with MeshLib's build type again (the forced Release was for the removed in-tree override copy), and mr_find_mimalloc has no TARGET guard. - The test keeps its name MRMimallocRedirectTests.cpp; bits() keeps `auto`; MRCudaSolarRadiation.cpp keeps the unused vector it had on master. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o bitset-mimalloc
Fedr
marked this pull request as draft
October 23, 2026 21:07
Fedr
added a commit
that referenced
this pull request
Oct 23, 2026
…malloc imported from the copied thirdparty libs - Code built against installed MeshLib does not see config_cmake.h (MR_USE_CMAKE_CONFIGURE_FILE is MeshLib's own), so the macOS Homebrew C++ examples compiled mi_stl_allocator and did not link (_mi_free). MRMesh now exports MR_STD_ALLOCATOR=1, the same value as config_cmake.h. - The .deb has no CMake config of mimalloc next to its copied thirdparty lib and include dirs, so MRMeshConfig imports libmimalloc from there (or next to MRMesh in vcpkg installs) as #7228 did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o bitset-mimalloc # Conflicts: # cmake/Modules/Mimalloc.cmake
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In MeshLib's own builds,
BitSetnow stores its blocks with mimalloc explicitly:BitSet::Blocks = std::vector<block_type, Allocator<block_type>>, where the newMRAllocator.hdefinesMR::Allocator<T>asmi_stl_allocator<T>, orstd::allocator<T>with Emscripten andMR_MIMALLOC_OVERRIDE, and MeshLib's executables no longer override malloc. Applications that override malloc, such as MeshInspector, setMR_MIMALLOC_OVERRIDE=ONand build exactly as on master. The dependency trees (CPM, vcpkg, Homebrew) are unchanged.MeshLib builds (
MR_MIMALLOC_OVERRIDE=OFF, default)mr_find_mimalloc().mimalloc.dll, as before. Its redirect engages only in executables set up bymr_enable_mimalloc/MimallocRedirect.props, and MRTest and MeshViewer no longer are.MRMimallocso it cannot collide with the dependencies'libmimalloc. It is installed next to the MeshLib libraries, and on Linux it uses dlopen-safe thread-locals.MRMeshConfig.cmakedefines themimalloctarget for code built against installed MeshLib:MRMimallocnext toMRMesh, or vcpkg's package on Windows. On MSVC,MRAllocator.hauto-linksmimalloc(-debug).dll.lib, so consumers that link onlyMRMeshby name (the C++ examples, distribution users) resolve the inlinemi_free.MRMimallocRedirectTests.cppchecks thatBitSetblocks, including ones allocated inside MRMesh, come from mimalloc and that malloc does not. On Linux it also checks that the process has a single mimalloc.std::allocator: withMR_EMSCRIPTEN_MIMALLOCmalloc is already mimalloc, and the C-bindings image (emsdk 3.1.38) has no mimalloc at all.bits()andfromBlocksare hidden from the bindings (MR_BIND_IGNORE), because mrbind drops custom allocators. No binding test or example used them.generate.mkreadsMR_MIMALLOC_OVERRIDEfrom MRMesh'sconfig_cmake.h, so the bindings agree with MRMesh onBitSet::Blocks.BitSet::Blocks, andDynamicArrayaccepts astd::vectorwith any allocator.Applications (
MR_MIMALLOC_OVERRIDE=ON)Everything is as on master.
BitSetusesstd::allocator, MeshLib libraries do not link mimalloc, and MRTest, MeshViewer and the application'smr_enable_mimallocexecutables override malloc with the dependencies' mimalloc.mr_enable_mimallocfails at configure time on macOS and Linux without the option. MeshInspector turns it on in a companion PR.🤖 Generated with Claude Code