--- .home/.cargo/macports/libmimalloc-sys-0.1.24/c_src/mimalloc/src/stats.c	1973-11-30 05:33:09.000000000 +0800
+++ .home/.cargo/macports/libmimalloc-sys-0.1.24/c_src/mimalloc/src/stats.c	2026-01-05 03:28:04.000000000 +0800
@@ -531,12 +531,20 @@
   *page_faults = 0;
 #elif defined(__APPLE__)
   *peak_rss = rusage.ru_maxrss;         // BSD reports in bytes
+#ifdef MACH_TASK_BASIC_INFO
   struct mach_task_basic_info info;
   mach_msg_type_number_t infoCount = MACH_TASK_BASIC_INFO_COUNT;
   if (task_info(mach_task_self(), MACH_TASK_BASIC_INFO, (task_info_t)&info, &infoCount) == KERN_SUCCESS) {
     *current_rss = (size_t)info.resident_size;
   }
 #else
+  struct task_basic_info info;
+  mach_msg_type_number_t infoCount = TASK_BASIC_INFO_COUNT;
+  if (task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)&info, &infoCount) == KERN_SUCCESS) {
+    *current_rss = (size_t)info.resident_size;
+  }
+#endif
+#else
   *peak_rss = rusage.ru_maxrss * 1024;  // Linux reports in KiB
 #endif  
 }

--- .home/.cargo/macports/libmimalloc-sys-0.1.24/c_src/mimalloc/src/random.c	1973-11-30 05:33:09.000000000 +0800
+++ .home/.cargo/macports/libmimalloc-sys-0.1.24/c_src/mimalloc/src/random.c	2026-01-05 04:52:55.000000000 +0800
@@ -11,6 +11,10 @@
 #include "mimalloc.h"
 #include "mimalloc-internal.h"
 
+#if defined(__APPLE__)
+#include <AvailabilityMacros.h>
+#endif
+
 #include <string.h> // memset
 
 /* ----------------------------------------------------------------------------
@@ -191,25 +195,14 @@
   return (RtlGenRandom(buf, (ULONG)buf_len) != 0);
 }
 #endif
-
-#elif defined(__APPLE__)
-#include <AvailabilityMacros.h>
-#if defined(MAC_OS_X_VERSION_10_10) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_10
+#elif defined(MAC_OS_X_VERSION_10_10) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_10
 #include <CommonCrypto/CommonRandom.h>
-#endif
 static bool os_random_buf(void* buf, size_t buf_len) {
-  #if defined(MAC_OS_X_VERSION_10_15) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_15
     // We prefere CCRandomGenerateBytes as it returns an error code while arc4random_buf
     // may fail silently on macOS. See PR #390, and <https://opensource.apple.com/source/Libc/Libc-1439.40.11/gen/FreeBSD/arc4random.c.auto.html>      
     return (CCRandomGenerateBytes(buf, buf_len) == kCCSuccess);
-  #else
-    // fall back on older macOS
-    arc4random_buf(buf, buf_len);
-    return true;
-  #endif
 }
-
-#elif defined(__ANDROID__) || defined(__DragonFly__) || \
+#elif defined(__ANDROID__) || defined(__APPLE__) || defined(__DragonFly__) || \
       defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
       defined(__sun) // todo: what to use with __wasi__?
 #include <stdlib.h>

--- .home/.cargo/macports/libmimalloc-sys-0.1.24/c_src/mimalloc/include/mimalloc-atomic.h	1973-11-30 05:33:09.000000000 +0800
+++ .home/.cargo/macports/libmimalloc-sys-0.1.24/c_src/mimalloc/include/mimalloc-atomic.h	2026-01-05 05:04:32.000000000 +0800
@@ -301,6 +301,10 @@
 static inline void mi_atomic_yield(void) {
   __asm__ volatile("yield" ::: "memory");
 }
+#elif defined(__POWERPC__)
+static inline void mi_atomic_yield(void) {
+  __asm__ __volatile__ ("or r27,r27,r27" ::: "memory");
+}
 #elif defined(__powerpc__) || defined(__ppc__) || defined(__PPC__)
 static inline void mi_atomic_yield(void) {
   __asm__ __volatile__ ("or 27,27,27" ::: "memory");
