gc: use mimalloc as allocator for GC objects
Switch to mimalloc as the primary allocator for garbage-collected objects
instead of relying on system malloc implementations. This addresses severe
performance degradation during garbage collection, particularly on Windows
where the system allocator can exhibit inefficient deallocation behavior.
Performance improvements on Linux:
- Large array deallocation: ~4x speedup
- Mixed allocations: ~1.3x speedup
- Allocation/deallocation churn: ~1.56x speedup
The implementation:
- Adds mimalloc as a new dependency (built as static library)
- Wraps malloc/free/realloc calls in gc-common.h to use mimalloc
- Automatically disables mimalloc when sanitizers are enabled
- Supports both BinaryBuilder (JLL) and source builds
Fixes #60448
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>