Skip to content

v3.2.8 fails to build on NetBSD #1219

@moubctez

Description

@moubctez

Building v3.2.8 fails on NetBSD with

In file included from /tmp/pkgsrc/devel/mimalloc/work/mimalloc-3.2.8/src/static.c:32:
/tmp/pkgsrc/devel/mimalloc/work/mimalloc-3.2.8/src/options.c:33:41: error: 'mi_option_eager_commit_delay' undeclared here (not in a function); did you mean 'mi_option_page_commit_on_demand'?
   33 | #define MI_OPTION(opt)                  mi_option_##opt, #opt, NULL
      |                                         ^~~~~~~~~~
/tmp/pkgsrc/devel/mimalloc/work/mimalloc-3.2.8/src/options.c:140:26: note: in expansion of macro 'MI_OPTION'
  140 |   { 0, MI_OPTION_UNINIT, MI_OPTION(eager_commit_delay) },         // the first N segments per thread are not eagerly committed
      |                          ^~~~~~~~~

My patch:

--- src/options.c.orig	2026-02-04 16:09:06.364196291 +0000
+++ src/options.c
@@ -136,11 +136,7 @@ static mi_option_desc_t mi_options[_mi_option_last] =
   { 0, MI_OPTION_UNINIT, MI_OPTION(deprecated_page_reset) },      // reset page memory on free
   { 0, MI_OPTION_UNINIT, MI_OPTION(deprecated_abandoned_page_purge) }, 
   { 0, MI_OPTION_UNINIT, MI_OPTION(deprecated_segment_reset) },   // reset segment memory on free (needs eager commit)
-#if defined(__NetBSD__)
-  { 0, MI_OPTION_UNINIT, MI_OPTION(eager_commit_delay) },         // the first N segments per thread are not eagerly committed
-#else
   { 1, MI_OPTION_UNINIT, MI_OPTION(deprecated_eager_commit_delay) },  
-#endif
   { 1000,MI_OPTION_UNINIT, MI_OPTION_LEGACY(purge_delay,reset_delay) },  // purge delay in milli-seconds
   { 0,   MI_OPTION_UNINIT, MI_OPTION(use_numa_nodes) },           // 0 = use available numa nodes, otherwise use at most N nodes.
   { 0,   MI_OPTION_UNINIT, MI_OPTION_LEGACY(disallow_os_alloc,limit_os_alloc) },           // 1 = do not use OS memory for allocation (but only reserved arenas)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions