summaryrefslogtreecommitdiff
path: root/usr.sbin/nsd/dbcreate.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/nsd/dbcreate.c')
-rw-r--r--usr.sbin/nsd/dbcreate.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/usr.sbin/nsd/dbcreate.c b/usr.sbin/nsd/dbcreate.c
index bf55dbac813..17cce792860 100644
--- a/usr.sbin/nsd/dbcreate.c
+++ b/usr.sbin/nsd/dbcreate.c
@@ -25,9 +25,17 @@ struct namedb *
namedb_new (const char *filename)
{
namedb_type *db;
- region_type *region = region_create_custom(xalloc, free,
+ region_type *region;
+
+#ifdef USE_MMAP_ALLOC
+ region = region_create_custom(mmap_alloc, mmap_free,
+ MMAP_ALLOC_CHUNK_SIZE, MMAP_ALLOC_LARGE_OBJECT_SIZE,
+ MMAP_ALLOC_INITIAL_CLEANUP_SIZE, 1);
+#else /* !USE_MMAP_ALLOC */
+ region = region_create_custom(xalloc, free,
DEFAULT_CHUNK_SIZE, DEFAULT_LARGE_OBJECT_SIZE,
DEFAULT_INITIAL_CLEANUP_SIZE, 1);
+#endif /* !USE_MMAP_ALLOC */
/* Make a new structure... */
db = (namedb_type *) region_alloc(region, sizeof(namedb_type));