Index: include/bu/mapped_file.h
===================================================================
--- include/bu/mapped_file.h	(revision 71111)
+++ include/bu/mapped_file.h	(working copy)
@@ -79,7 +79,11 @@
  * For appl == "db_i", file is a ".g" database & apbuf is (struct db_i *).
  */
 struct bu_mapped_file {
-    struct bu_list l;
+    struct bu_mapped_file_tbl *tbl;
+    size_t idx;
+
+    char is_active;
+    char have_apbuf;
     char *name;		/**< bu_strdup() of file name */
     void *buf;	/**< In-memory copy of file (may be mmapped)  */
     size_t buflen;	/**< # bytes in 'buf'  */
@@ -94,6 +98,24 @@
 typedef struct bu_mapped_file bu_mapped_file_t;
 #define BU_MAPPED_FILE_NULL ((struct bu_mapped_file *)0)
 
+struct bu_mapped_file_tbl {
+    size_t size, capacity;
+    char *is_active;
+    char *have_apbuf;
+
+    /** see `struct bu_mapped_file` for meaning */
+    char    * *name;
+    void    * *buf;
+    size_t  * buflen;
+    int     * is_mapped;
+    char    * *appl;
+    void    * *apbuf;
+    size_t  * apbuflen;
+    time_t  * modtime;
+    int     * uses;
+    int     * dont_restat;
+};
+
 /**
  * assert the integrity of a bu_mapped_file struct.
  */
Index: src/libbu/mappedfile.c
===================================================================
--- src/libbu/mappedfile.c	(revision 71111)
+++ src/libbu/mappedfile.c	(working copy)
@@ -39,7 +39,6 @@
 
 #include "bu/debug.h"
 #include "bu/file.h"
-#include "bu/list.h"
 #include "bu/log.h"
 #include "bu/malloc.h"
 #include "bu/mapped_file.h"
@@ -49,7 +48,7 @@
 
 
 /* list of currently open mapped files */
-static struct bu_list bu_mapped_file_list = BU_LIST_INIT_ZERO;
+static struct bu_mapped_file_tbl bu_mapped_file_list;
 
 
 struct bu_mapped_file *
@@ -57,7 +56,7 @@
 /* file name */
 /* non-null only when app. will use 'apbuf' */
 {
-    struct bu_mapped_file *mp = (struct bu_mapped_file *)NULL;
+    struct bu_mapped_file *mp;
     char *real_path = bu_realpath(name, NULL);
 #ifdef HAVE_SYS_STAT_H
     struct stat sb;
@@ -68,6 +67,7 @@
     FILE *fp = (FILE *)NULL;	/* stdio file pointer */
 #endif
     int ret;
+    size_t i;
 
     if (UNLIKELY(bu_debug&BU_DEBUG_MAPPED_FILE))
 	bu_log("bu_open_mapped_file(%s(canonical path - %s), %s)\n", name, real_path, appl?appl:"(NIL)");
@@ -74,24 +74,22 @@
 
     /* See if file has already been mapped, and can be shared */
     bu_semaphore_acquire(BU_SEM_MAPPEDFILE);
-    if (!BU_LIST_IS_INITIALIZED(&bu_mapped_file_list)) {
-	BU_LIST_INIT(&bu_mapped_file_list);
-    }
 
-    for (BU_LIST_FOR(mp, bu_mapped_file, &bu_mapped_file_list)) {
-	BU_CK_MAPPED_FILE(mp);
+    for (i = 0; i < bu_mapped_file_list.size; i++) {
 
 	/* find a match */
 
-	if (!BU_STR_EQUAL(real_path, mp->name))
+	if (!BU_STR_EQUAL(real_path, bu_mapped_file_list.name[i]))
 	    continue;
-	if (appl && !BU_STR_EQUAL(appl, mp->appl))
+	if (appl && !BU_STR_EQUAL(appl, bu_mapped_file_list.appl[i]))
 	    continue;
+	if (!bu_mapped_file_list.is_active[i])
+	    continue;
 
 	/* found a match */
 
 	/* if mapped file still exists, verify size and modtime */
-	if (!mp->dont_restat) {
+	if (!bu_mapped_file_list.dont_restat[i]) {
 
 	    bu_semaphore_acquire(BU_SEM_SYSCALL);
 	    fd = open(real_path, O_RDONLY | O_BINARY);
@@ -116,21 +114,28 @@
 		    bu_semaphore_release(BU_SEM_SYSCALL);
 		    fd = -1;
 		}
-		if ((size_t)sb.st_size != mp->buflen) {
+		if ((size_t)sb.st_size != bu_mapped_file_list.buflen[i]) {
 		    if (UNLIKELY(bu_debug&BU_DEBUG_MAPPED_FILE)) {
-			bu_log("bu_open_mapped_file(%s) WARNING: File size changed from %ld to %ld, opening new version.\n", real_path, mp->buflen, sb.st_size);
+			bu_log("bu_open_mapped_file(%s) "
+			       "WARNING: File size changed from %ld to %ld, "
+			       "opening new version.\n",
+			       real_path,
+			       bu_mapped_file_list.buflen[i],
+			       sb.st_size);
 		    }
-		    /* mp doesn't reflect the file any longer.  Invalidate. */
-		    mp->appl = bu_strdup("__STALE__");
+		    /* doesn't reflect the file any longer.  Invalidate. */
+		    bu_mapped_file_list.appl[i] = bu_strdup("__STALE__");
 		    /* Can't invalidate old copy, it may still be in use. */
 		    break;
 		}
-		if (sb.st_mtime != mp->modtime) {
+		if (sb.st_mtime != bu_mapped_file_list.modtime[i]) {
 		    if (UNLIKELY(bu_debug&BU_DEBUG_MAPPED_FILE)) {
-			bu_log("bu_open_mapped_file(%s) WARNING: File modified since last mapped, opening new version.\n", real_path);
+			bu_log("bu_open_mapped_file(%s) "
+			       "WARNING: File modified since last mapped, "
+			       "opening new version.\n", real_path);
 		    }
-		    /* mp doesn't reflect the file any longer.  Invalidate. */
-		    mp->appl = bu_strdup("__STALE__");
+		    /* doesn't reflect the file any longer.  Invalidate. */
+		    bu_mapped_file_list.appl[i] = bu_strdup("__STALE__");
 		    /* Can't invalidate old copy, it may still be in use. */
 		    break;
 		}
@@ -138,29 +143,62 @@
 #endif
 	    }
 
-	    /* It is safe to reuse mp */
-	    mp->uses++;
+	    /* It is safe to reuse */
+	    bu_mapped_file_list.uses[i]++;
 
 	    bu_semaphore_release(BU_SEM_MAPPEDFILE);
-	    if (UNLIKELY(bu_debug&BU_DEBUG_MAPPED_FILE))
+
+	    mp = bu_malloc(sizeof(struct bu_mapped_file), "ALLOC mp 1");
+	    mp->have_apbuf = bu_mapped_file_list.have_apbuf[i];
+	    mp->is_active = bu_mapped_file_list.is_active[i];
+	    mp->name = bu_mapped_file_list.name[i];
+	    mp->buf = bu_mapped_file_list.buf[i];
+	    mp->buflen = bu_mapped_file_list.buflen[i];
+	    mp->is_mapped = bu_mapped_file_list.is_mapped[i];
+	    mp->appl = bu_mapped_file_list.appl[i];
+	    mp->apbuf = bu_mapped_file_list.apbuf[i];
+	    mp->apbuflen = bu_mapped_file_list.apbuflen[i];
+	    mp->modtime = bu_mapped_file_list.modtime[i];
+	    mp->uses = bu_mapped_file_list.uses[i];
+	    mp->dont_restat = bu_mapped_file_list.dont_restat[i];
+	    mp->tbl = &bu_mapped_file_list;
+	    mp->idx = i;
+
+	    if (UNLIKELY(bu_debug&BU_DEBUG_MAPPED_FILE)) {
 		bu_pr_mapped_file("open_reused", mp);
+	    }
 
 	    return mp;
 	}
 
 	/* It is safe to reuse mp */
-	mp->uses++;
+	bu_mapped_file_list.uses[i]++;
 
 	bu_semaphore_release(BU_SEM_MAPPEDFILE);
+
+	mp = bu_malloc(sizeof(struct bu_mapped_file), "ALLOC mp 1");
+	mp->have_apbuf = bu_mapped_file_list.have_apbuf[i];
+	mp->is_active = bu_mapped_file_list.is_active[i];
+	mp->name = bu_mapped_file_list.name[i];
+	mp->buf = bu_mapped_file_list.buf[i];
+	mp->buflen = bu_mapped_file_list.buflen[i];
+	mp->is_mapped = bu_mapped_file_list.is_mapped[i];
+	mp->appl = bu_mapped_file_list.appl[i];
+	mp->apbuf = bu_mapped_file_list.apbuf[i];
+	mp->apbuflen = bu_mapped_file_list.apbuflen[i];
+	mp->modtime = bu_mapped_file_list.modtime[i];
+	mp->uses = bu_mapped_file_list.uses[i];
+	mp->dont_restat = bu_mapped_file_list.dont_restat[i];
+	mp->tbl = &bu_mapped_file_list;
+	mp->idx = i;
+
+
+	bu_semaphore_release(BU_SEM_MAPPEDFILE);
 	return mp;
-
     }
     /* done iterating over mapped file list */
     bu_semaphore_release(BU_SEM_MAPPEDFILE);
 
-    /* necessary in case we take a 'fail' path before BU_ALLOC() */
-    mp = NULL;
-
     /* File is not yet mapped or has changed, open file read only if
      * we didn't find it earlier.
      */
@@ -193,27 +231,72 @@
 #endif /* HAVE_SYS_STAT_H */
 
     /* Optimistically assume that things will proceed OK */
-    BU_ALLOC(mp, struct bu_mapped_file);
-    mp->name = bu_strdup(real_path);
-    if (appl)
-	mp->appl = bu_strdup(appl);
+    if (bu_mapped_file_list.size == bu_mapped_file_list.capacity) {
+        bu_mapped_file_list.capacity = bu_mapped_file_list.capacity == 0 ? 1 : bu_mapped_file_list.capacity * 2;
+        bu_mapped_file_list.is_active = bu_realloc(bu_mapped_file_list.is_active,
+                bu_mapped_file_list.capacity * sizeof(bu_mapped_file_list.is_active[0]),
+                "realloc bu_mapped_file_list.is_active");
+        bu_mapped_file_list.have_apbuf = bu_realloc(bu_mapped_file_list.have_apbuf,
+                bu_mapped_file_list.capacity * sizeof(bu_mapped_file_list.have_apbuf[0]),
+                "realloc bu_mapped_file_list.have_apbuf");
+        bu_mapped_file_list.name = bu_realloc(bu_mapped_file_list.name,
+                bu_mapped_file_list.capacity * sizeof(bu_mapped_file_list.name[0]),
+                "realloc bu_mapped_file_list.name");
+        bu_mapped_file_list.buf = bu_realloc(bu_mapped_file_list.buf,
+                bu_mapped_file_list.capacity * sizeof(bu_mapped_file_list.buf[0]),
+                "realloc bu_mapped_file_list.buf");
+        bu_mapped_file_list.buflen = bu_realloc(bu_mapped_file_list.buflen,
+                bu_mapped_file_list.capacity * sizeof(bu_mapped_file_list.buflen[0]),
+                "realloc bu_mapped_file_list.buflen");
+        bu_mapped_file_list.is_mapped = bu_realloc(bu_mapped_file_list.is_mapped,
+                bu_mapped_file_list.capacity * sizeof(bu_mapped_file_list.is_mapped[0]),
+                "realloc bu_mapped_file_list.is_mapped");
+        bu_mapped_file_list.appl = bu_realloc(bu_mapped_file_list.appl,
+                bu_mapped_file_list.capacity * sizeof(bu_mapped_file_list.appl[0]),
+                "realloc bu_mapped_file_list.appl");
+        bu_mapped_file_list.apbuf = bu_realloc(bu_mapped_file_list.apbuf,
+                bu_mapped_file_list.capacity * sizeof(bu_mapped_file_list.apbuf[0]),
+                "realloc bu_mapped_file_list.apbuf");
+        bu_mapped_file_list.apbuflen = bu_realloc(bu_mapped_file_list.apbuflen,
+                bu_mapped_file_list.capacity * sizeof(bu_mapped_file_list.apbuflen[0]),
+                "realloc bu_mapped_file_list.apbuflen");
+        bu_mapped_file_list.modtime = bu_realloc(bu_mapped_file_list.modtime,
+                bu_mapped_file_list.capacity * sizeof(bu_mapped_file_list.modtime[0]),
+                "realloc bu_mapped_file_list.modtime");
+        bu_mapped_file_list.uses = bu_realloc(bu_mapped_file_list.uses,
+                bu_mapped_file_list.capacity * sizeof(bu_mapped_file_list.uses[0]),
+                "realloc bu_mapped_file_list.uses");
+        bu_mapped_file_list.dont_restat = bu_realloc(bu_mapped_file_list.dont_restat,
+                bu_mapped_file_list.capacity * sizeof(bu_mapped_file_list.dont_restat[0]),
+                "realloc bu_mapped_file_list.dont_restat");
+    }
 
+    bu_mapped_file_list.have_apbuf[bu_mapped_file_list.size] = 0;
+    bu_mapped_file_list.is_active[bu_mapped_file_list.size] = 1;
+    bu_mapped_file_list.dont_restat[bu_mapped_file_list.size] = 0;
+
+    bu_mapped_file_list.name[bu_mapped_file_list.size] = bu_strdup(real_path);
+    if (appl) {
+        bu_mapped_file_list.appl[bu_mapped_file_list.size] = bu_strdup(appl);
+    }
+
 #ifdef HAVE_SYS_STAT_H
-    mp->buflen = sb.st_size;
-    mp->modtime = sb.st_mtime;
+    bu_mapped_file_list.buflen[bu_mapped_file_list.size] = sb.st_size;
+    bu_mapped_file_list.modtime[bu_mapped_file_list.size] = sb.st_mtime;
 #  ifdef HAVE_SYS_MMAN_H
 
     /* Attempt to access as memory-mapped file */
     bu_semaphore_acquire(BU_SEM_SYSCALL);
-    mp->buf = mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
+    bu_mapped_file_list.buf[bu_mapped_file_list.size] = mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
     bu_semaphore_release(BU_SEM_SYSCALL);
 
-    if (UNLIKELY(mp->buf == MAP_FAILED))
+    if (UNLIKELY(bu_mapped_file_list.buf[bu_mapped_file_list.size] == MAP_FAILED)) {
 	perror(real_path);
+    }
 
-    if (mp->buf != MAP_FAILED) {
+    if (bu_mapped_file_list.buf[bu_mapped_file_list.size] != MAP_FAILED) {
 	/* OK, its memory mapped in! */
-	mp->is_mapped = 1;
+	bu_mapped_file_list.is_mapped[bu_mapped_file_list.size] = 1;
 	/* It's safe to close the fd now, the manuals say */
     } else
 #  endif /* HAVE_SYS_MMAN_H */
@@ -221,17 +304,17 @@
 	/* Allocate a local zero'd buffer, and slurp it in always
 	 * leaving space for a trailing zero.
 	 */
-	mp->buf = bu_calloc(1, sb.st_size+1, real_path);
+	bu_mapped_file_list.buf[bu_mapped_file_list.size] = bu_calloc(1, sb.st_size+1, real_path);
 
 	nbytes = 0;
 	bytes_to_go = sb.st_size;
 	bu_semaphore_acquire(BU_SEM_SYSCALL);
 	while (nbytes < sb.st_size) {
-	    readval = read(fd, ((char *)(mp->buf)) + nbytes, ((bytes_to_go > INT_MAX) ? (INT_MAX) : (bytes_to_go)));
+	    readval = read(fd, ((char *)(bu_mapped_file_list.buf[bu_mapped_file_list.size])) + nbytes, ((bytes_to_go > INT_MAX) ? (INT_MAX) : (bytes_to_go)));
 	    if (UNLIKELY(readval < 0)) {
 		bu_semaphore_release(BU_SEM_SYSCALL);
 		perror(real_path);
-		bu_free(mp->buf, real_path);
+		bu_free(bu_mapped_file_list.buf[bu_mapped_file_list.size], real_path);
 		goto fail;
 	    } else {
 		nbytes += readval;
@@ -242,7 +325,7 @@
 
 	if (UNLIKELY(nbytes != sb.st_size)) {
 	    perror(real_path);
-	    bu_free(mp->buf, real_path);
+	    bu_free(bu_mapped_file_list.buf[bu_mapped_file_list.size], real_path);
 	    goto fail;
 	}
     }
@@ -262,21 +345,24 @@
     {
 	char buf[32768] = {0};
 	int got;
-	mp->buflen = 0;
+	bu_mapped_file_list.buflen[bu_mapped_file_list.size] = 0;
 
 	bu_semaphore_acquire(BU_SEM_SYSCALL);
-	while ((got = fread(buf, 1, sizeof(buf), fp)) > 0)
-	    mp->buflen += got;
+	while ((got = fread(buf, 1, sizeof(buf), fp)) > 0) {
+	    bu_mapped_file_list.buflen[bu_mapped_file_list.size] += got;
+	}
 	rewind(fp);
 	bu_semaphore_release(BU_SEM_SYSCALL);
 
     }
     /* Allocate the necessary buffer */
-    mp->buf = bu_calloc(1, mp->buflen+1, real_path);
+    bu_mapped_file_list.buf[bu_mapped_file_list.size] = bu_calloc(1, bu_mapped_file_list.buflen[bu_mapped_file_list.size]+1, real_path);
 
     /* Read it again into the buffer */
     bu_semaphore_acquire(BU_SEM_SYSCALL);
-    ret = fread(mp->buf, mp->buflen, 1, fp);
+    ret = fread(
+            bu_mapped_file_list.buf[bu_mapped_file_list.size],
+            bu_mapped_file_list.buflen[bu_mapped_file_list.size], 1, fp);
     bu_semaphore_release(BU_SEM_SYSCALL);
 
     if (UNLIKELY(ret != 1)) {
@@ -285,8 +371,10 @@
 	fclose(fp);
 	bu_semaphore_release(BU_SEM_SYSCALL);
 
-	bu_log("bu_open_mapped_file() 2nd fread failed? len=%d\n", mp->buflen);
-	bu_free(mp->buf, "non-unix fread buf");
+	bu_log("bu_open_mapped_file() 2nd fread failed? len=%d\n",
+	       bu_mapped_file_list.buflen[bu_mapped_file_list.size]);
+	bu_free(bu_mapped_file_list.buf[bu_mapped_file_list.size],
+	        "non-unix fread buf");
 	goto fail;
     }
 
@@ -301,19 +389,36 @@
 	bu_semaphore_release(BU_SEM_SYSCALL);
     }
 
-    mp->uses = 1;
-    mp->l.magic = BU_MAPPED_FILE_MAGIC;
+    bu_mapped_file_list.uses[bu_mapped_file_list.size] = 1;
 
+    mp = bu_malloc(sizeof(struct bu_mapped_file), "ALLOC mp 3");
+    mp->have_apbuf = bu_mapped_file_list.have_apbuf[bu_mapped_file_list.size];
+    mp->is_active = bu_mapped_file_list.is_active[bu_mapped_file_list.size];
+    mp->name = bu_mapped_file_list.name[bu_mapped_file_list.size];
+    mp->buf = bu_mapped_file_list.buf[bu_mapped_file_list.size];
+    mp->buflen = bu_mapped_file_list.buflen[bu_mapped_file_list.size];
+    mp->is_mapped = bu_mapped_file_list.is_mapped[bu_mapped_file_list.size];
+    mp->appl = bu_mapped_file_list.appl[bu_mapped_file_list.size];
+    mp->apbuf = bu_mapped_file_list.apbuf[bu_mapped_file_list.size];
+    mp->apbuflen = bu_mapped_file_list.apbuflen[bu_mapped_file_list.size];
+    mp->modtime = bu_mapped_file_list.modtime[bu_mapped_file_list.size];
+    mp->uses = bu_mapped_file_list.uses[bu_mapped_file_list.size];
+    mp->dont_restat = bu_mapped_file_list.dont_restat[bu_mapped_file_list.size];
+    mp->tbl = &bu_mapped_file_list;
+    mp->idx = bu_mapped_file_list.size;
+
     bu_semaphore_acquire(BU_SEM_MAPPEDFILE);
-    BU_LIST_APPEND(&bu_mapped_file_list, &mp->l);
+    bu_mapped_file_list.size++;
     bu_semaphore_release(BU_SEM_MAPPEDFILE);
 
     if (UNLIKELY(bu_debug&BU_DEBUG_MAPPED_FILE)) {
 	bu_pr_mapped_file("1st_open", mp);
     }
+
     if (real_path) {
 	bu_free(real_path, "real_path alloc from bu_realpath");
     }
+
     return mp;
 
 fail:
@@ -323,12 +428,12 @@
 	bu_semaphore_release(BU_SEM_SYSCALL);
     }
 
-    if (mp) {
-	bu_free(mp->name, "mp->name");
-	if (mp->appl)
-	    bu_free(mp->appl, "mp->appl");
-	/* Don't free mp->buf here, it might not be bu_malloced but mmaped */
-	bu_free(mp, "mp from bu_open_mapped_file fail");
+    if (bu_mapped_file_list.size < bu_mapped_file_list.capacity &&
+            bu_mapped_file_list.is_active[bu_mapped_file_list.size]) {
+        bu_free(bu_mapped_file_list.name[bu_mapped_file_list.size], "mp->name");
+        if (bu_mapped_file_list.appl[bu_mapped_file_list.size]) {
+	    bu_free(bu_mapped_file_list.appl[bu_mapped_file_list.size], "mp->appl");
+        }
     }
 
     if (UNLIKELY(bu_debug&BU_DEBUG_MAPPED_FILE))
@@ -346,18 +451,24 @@
 void
 bu_close_mapped_file(struct bu_mapped_file *mp)
 {
-    if (UNLIKELY(!mp)) {
+    if (UNLIKELY(mp == NULL)) {
 	bu_log("bu_close_mapped_file() called with null pointer\n");
 	return;
     }
 
-    BU_CK_MAPPED_FILE(mp);
+    if (UNLIKELY(!mp->is_active)) {
+        return;
+    }
 
-    if (UNLIKELY(bu_debug&BU_DEBUG_MAPPED_FILE))
+    if (UNLIKELY(bu_debug&BU_DEBUG_MAPPED_FILE)) {
 	bu_pr_mapped_file("close:uses--", mp);
+    }
 
     bu_semaphore_acquire(BU_SEM_MAPPEDFILE);
     --mp->uses;
+    if (mp->tbl != NULL) {
+        --((mp->tbl)->uses[mp->idx]);
+    }
     bu_semaphore_release(BU_SEM_MAPPEDFILE);
 }
 
@@ -365,11 +476,10 @@
 void
 bu_pr_mapped_file(const char *title, const struct bu_mapped_file *mp)
 {
-    if (UNLIKELY(!mp))
+    if (UNLIKELY(mp == NULL)) {
 	return;
+    }
 
-    BU_CK_MAPPED_FILE(mp);
-
     bu_log("%p mapped_file %s %p len=%ld mapped=%d, uses=%d %s\n",
 	   (void *)mp, mp->name, mp->buf, mp->buflen,
 	   mp->is_mapped, mp->uses,
@@ -380,57 +490,75 @@
 void
 bu_free_mapped_files(int verbose)
 {
-    struct bu_mapped_file *mp, *next;
+    struct bu_mapped_file mp;
+    size_t i;
 
     if (UNLIKELY(bu_debug&BU_DEBUG_MAPPED_FILE))
 	bu_log("bu_free_mapped_files(verbose=%d)\n", verbose);
 
+    if (bu_mapped_file_list.size == 0) {
+        return;
+    }
+
     bu_semaphore_acquire(BU_SEM_MAPPEDFILE);
 
-    next = BU_LIST_FIRST(bu_mapped_file, &bu_mapped_file_list);
-    while (BU_LIST_NOT_HEAD(next, &bu_mapped_file_list)) {
-	BU_CK_MAPPED_FILE(next);
-	mp = next;
-	next = BU_LIST_NEXT(bu_mapped_file, &mp->l);
+    while (--bu_mapped_file_list.size) {
+	i = bu_mapped_file_list.size;
 
-	if (mp->uses > 0)
+	if (bu_mapped_file_list.uses[i] > 0) {
 	    continue;
+	}
 
+	mp.name = bu_mapped_file_list.name[i];
+	mp.buf = bu_mapped_file_list.buf[i];
+	mp.buflen = bu_mapped_file_list.buflen[i];
+	mp.is_mapped = bu_mapped_file_list.is_mapped[i];
+	mp.appl = bu_mapped_file_list.appl[i];
+	mp.apbuf = bu_mapped_file_list.apbuf[i];
+	mp.apbuflen = bu_mapped_file_list.apbuflen[i];
+	mp.modtime = bu_mapped_file_list.modtime[i];
+	mp.uses = bu_mapped_file_list.uses[i];
+	mp.dont_restat = bu_mapped_file_list.dont_restat[i];
+	mp.tbl = &bu_mapped_file_list;
+	mp.idx = i;
+
 	/* Found one that needs to have storage released */
-	if (UNLIKELY(verbose || (bu_debug&BU_DEBUG_MAPPED_FILE)))
-	    bu_pr_mapped_file("freeing", mp);
+	if (UNLIKELY(verbose || (bu_debug&BU_DEBUG_MAPPED_FILE))) {
+	    bu_pr_mapped_file("freeing", &mp);
+	}
 
-	BU_LIST_DEQUEUE(&mp->l);
+        (mp.tbl)->is_active[mp.idx] = 0;
 
 	/* If application pointed mp->apbuf at mp->buf, break that
 	 * association so we don't double-free the buffer.
 	 */
-	if (mp->apbuf == mp->buf)
-	    mp->apbuf = (void *)NULL;
+	if (mp.apbuf == mp.buf) {
+	    (mp.tbl)->apbuf[mp.idx] = (void *) NULL;
+	}
 
 #ifdef HAVE_SYS_MMAN_H
-	if (mp->is_mapped) {
+	if (mp.is_mapped) {
 	    int ret;
 	    bu_semaphore_acquire(BU_SEM_SYSCALL);
-	    ret = munmap(mp->buf, (size_t)mp->buflen);
+	    ret = munmap(mp.buf, (size_t) mp.buflen);
 	    bu_semaphore_release(BU_SEM_SYSCALL);
 
-	    if (UNLIKELY(ret < 0))
+	    if (UNLIKELY(ret < 0)) {
 		perror("munmap");
+	    }
 
 	    /* XXX How to get this chunk of address space back to malloc()? */
 	} else
 #endif
 	{
-	    bu_free(mp->buf, "bu_mapped_file.buf[]");
+	    bu_free(mp.buf, "bu_mapped_file.buf[]");
 	}
-	mp->buf = (void *)NULL;		/* sanity */
-	bu_free((void *)mp->name, "bu_mapped_file.name");
+	(mp.tbl)->buf[mp.idx] = (void *)NULL;
+	bu_free((void *) mp.name, "bu_mapped_file.name");
 
-	if (mp->appl)
-	    bu_free((void *)mp->appl, "bu_mapped_file.appl");
-
-	bu_free((void *)mp, "struct bu_mapped_file");
+	if (mp.appl) {
+	    bu_free((void *)mp.appl, "bu_mapped_file.appl");
+	}
     }
     bu_semaphore_release(BU_SEM_MAPPEDFILE);
 }
Index: src/libbu/temp.c
===================================================================
--- src/libbu/temp.c	(revision 71111)
+++ src/libbu/temp.c	(working copy)
@@ -36,7 +36,6 @@
 
 #include "bu/file.h"
 #include "bu/log.h"
-#include "bu/list.h"
 #include "bu/malloc.h"
 #include "bu/time.h"
 #include "bu/vls.h"
@@ -52,13 +51,13 @@
 
 
 struct temp_file_list {
-    struct bu_list l;
-    struct bu_vls fn;
-    int fd;
+    size_t size, capacity;
+
+    struct bu_vls *fn;
+    int *fd;
 };
 
-static int temp_files = 0;
-static struct temp_file_list *TF = NULL;
+static struct temp_file_list TF;
 
 /* Get Windows to shut up about trying to close an already closed file -
  * the libbu temp_close_files routine is designed to make sure that any
@@ -80,55 +79,38 @@
 #if defined(HAVE_WINDOWS_H)
     _invalid_parameter_handler stdhandler, nhandler;
 #endif
-    struct temp_file_list *popped;
-    if (!TF) {
+    size_t i;
+
+    if (TF.size == 0) {
 	return;
     }
 
 #if defined(HAVE_WINDOWS_H)
-	nhandler = disable_duplicate_close_check;
+    nhandler = disable_duplicate_close_check;
     stdhandler = _set_invalid_parameter_handler(nhandler);
-	/* Turn off the message box as well. */
-	(void)_CrtSetReportMode(_CRT_ASSERT, 0);
-#endif 
+    /* Turn off the message box as well. */
+    (void)_CrtSetReportMode(_CRT_ASSERT, 0);
+#endif
 
-    /* close all files, free their nodes, and unlink */
-    while (BU_LIST_WHILE(popped, temp_file_list, &(TF->l))) {
-	if (!popped)
-	    break;
+    for (i = 0; i < TF.size; i++) {
+        if (TF.fd[i] != -1) {
+            close(TF.fd[i]);
+            TF.fd[i] = -1;
+        }
 
-	/* take it off the list */
-	BU_LIST_DEQUEUE(&(popped->l));
-
-	/* close up shop */
-	if (popped->fd != -1) {
-	    close(popped->fd);
-	    popped->fd = -1;
-	}
-
-	/* burn the house down */
-	if (BU_VLS_IS_INITIALIZED(&popped->fn) && bu_vls_addr(&popped->fn)) {
-	    bu_file_delete(bu_vls_addr(&popped->fn));
-	    bu_vls_free(&popped->fn);
-	}
-	BU_PUT(popped, struct temp_file_list);
+        if (BU_VLS_IS_INITIALIZED(&TF.fn[i]) && bu_vls_addr(&TF.fn[i])) {
+            bu_file_delete(bu_vls_addr(&TF.fn[i]));
+            bu_vls_free(&TF.fn[i]);
+        }
     }
 
-    /* free the head */
-    if (TF->fd != -1) {
-	close(TF->fd);
-	TF->fd = -1;
-    }
-    if (BU_VLS_IS_INITIALIZED(&TF->fn) && bu_vls_addr(&TF->fn)) {
-	bu_file_delete(bu_vls_addr(&TF->fn));
-	bu_vls_free(&TF->fn);
-    }
-    BU_PUT(TF, struct temp_file_list);
+    bu_free(TF.fn, "TF.fn free");
+    bu_free(TF.fd, "TF.fd free");
 
 #if defined(HAVE_WINDOWS_H)
     /* Now that we're done, restore default behavior */
     (void)_set_invalid_parameter_handler(stdhandler);
-#endif 
+#endif
 
 }
 
@@ -136,34 +118,22 @@
 HIDDEN void
 temp_add_to_list(const char *fn, int fd)
 {
-    struct temp_file_list *newtf;
+    if (TF.size == TF.capacity) {
+        TF.capacity = TF.capacity == 0 ? 1 : TF.capacity * 2;
 
-    temp_files++;
+        TF.fn = bu_realloc(TF.fn, sizeof(TF.fn[0]) * TF.capacity, "TF.fn realloc");
+        TF.fd = bu_realloc(TF.fd, sizeof(TF.fd[0]) * TF.capacity, "TF.fd realloc");
+    }
 
-    if (temp_files == 1) {
+    if (TF.size == 1) {
 	/* schedule files for closure on exit */
 	atexit(temp_close_files);
-
-	BU_GET(TF, struct temp_file_list);
-	BU_LIST_INIT(&(TF->l));
-	bu_vls_init(&TF->fn);
-
-	bu_vls_strcpy(&TF->fn, fn);
-	TF->fd = fd;
-
-	return;
     }
 
-    BU_GET(newtf, struct temp_file_list);
-    BU_LIST_INIT(&(TF->l));
-    bu_vls_init(&TF->fn);
-
-    bu_vls_strcpy(&TF->fn, fn);
-    newtf->fd = fd;
-
-    BU_LIST_PUSH(&(TF->l), &(newtf->l));
-
-    return;
+    bu_vls_init(&TF.fn[TF.size]);
+    bu_vls_strcpy(&TF.fn[TF.size], fn);
+    TF.fd[TF.size] = fd;
+    TF.size++;
 }
 
 
Index: src/liboptical/sh_billboard.c
===================================================================
--- src/liboptical/sh_billboard.c	(revision 71111)
+++ src/liboptical/sh_billboard.c	(working copy)
@@ -144,7 +144,6 @@
 	bu_log("error opening image %s\n", bu_vls_addr(&bbd_sp->img_filename));
 	bu_bomb("");
     }
-    BU_CK_MAPPED_FILE(bbdi->img_mf);
 
     bbdi->img_width = bbd_sp->img_width;
     bbdi->img_width = bbd_sp->img_height;
Index: src/librt/db5_scan.c
===================================================================
--- src/librt/db5_scan.c	(revision 71111)
+++ src/librt/db5_scan.c	(working copy)
@@ -58,7 +58,6 @@
 	const unsigned char *cp = (const unsigned char *)dbip->dbi_inmem;
 	off_t eof;
 
-	BU_CK_MAPPED_FILE(dbip->dbi_mf);
 	eof = (off_t)dbip->dbi_mf->buflen;
 
 	if (db5_header_is_valid(cp) == 0) {
Index: src/librt/db_open.c
===================================================================
--- src/librt/db_open.c	(revision 71111)
+++ src/librt/db_open.c	(working copy)
@@ -82,9 +82,9 @@
 	}
 
 	/* Is this a re-use of a previously mapped file? */
-	if (mfp->apbuf) {
+	if (mfp->have_apbuf) {
 	    dbip = (struct db_i *)mfp->apbuf;
-	    RT_CK_DBI(dbip);
+            RT_CK_DBI(dbip);
 	    dbip->dbi_uses++;
 
 	    /*
Index: src/librt/primitives/dsp/dsp.c
===================================================================
--- src/librt/primitives/dsp/dsp.c	(revision 71111)
+++ src/librt/primitives/dsp/dsp.c	(working copy)
@@ -851,11 +851,10 @@
     switch (dsp_ip->dsp_datasrc) {
 	case RT_DSP_SRC_V4_FILE:
 	case RT_DSP_SRC_FILE:
-	    if (!dsp_ip->dsp_mp) {
+	    if (!dsp_ip->dsp_mp || !dsp_ip->dsp_mp->is_active) {
 		bu_log("dsp(%s): no data file or data file empty\n", bu_vls_addr(&dsp_ip->dsp_name));
 		return 1; /* BAD */
 	    }
-	    BU_CK_MAPPED_FILE(dsp_ip->dsp_mp);
 
 	    /* we do this here and now because we will need it for the
 	     * dsp_specific structure in a few lines
@@ -983,7 +982,6 @@
 		bu_log("dsp(%s): no data file or data file empty\n", bu_vls_addr(&dsp_ip->dsp_name));
 		return 1; /* BAD */
 	    }
-	    BU_CK_MAPPED_FILE(dsp_ip->dsp_mp);
 
 	    /* we do this here and now because we will need it for the
 	     * dsp_specific structure in a few lines
@@ -2552,7 +2550,6 @@
     switch (dsp->dsp_i.dsp_datasrc) {
 	case RT_DSP_SRC_V4_FILE:
 	case RT_DSP_SRC_FILE:
-	    BU_CK_MAPPED_FILE(dsp->dsp_i.dsp_mp);
 	    break;
 	case RT_DSP_SRC_OBJ:
 	    RT_CK_DB_INTERNAL(dsp->dsp_i.dsp_bip);
@@ -2803,7 +2800,6 @@
     switch (dsp->dsp_i.dsp_datasrc) {
 	case RT_DSP_SRC_V4_FILE:
 	case RT_DSP_SRC_FILE:
-	    BU_CK_MAPPED_FILE(dsp->dsp_i.dsp_mp);
 	    break;
 	case RT_DSP_SRC_OBJ:
 	    RT_CK_DB_INTERNAL(dsp->dsp_i.dsp_bip);
@@ -3139,7 +3135,6 @@
 		}
 		return 0;
 	    }
-	    BU_CK_MAPPED_FILE(dsp_ip->dsp_mp);
 	    break;
 	case RT_DSP_SRC_OBJ:
 	    if (!dsp_ip->dsp_bip) {
@@ -3519,7 +3514,6 @@
 		}
 		return -1;
 	    }
-	    BU_CK_MAPPED_FILE(dsp_ip->dsp_mp);
 	    break;
 	case RT_DSP_SRC_OBJ:
 	    if (!dsp_ip->dsp_bip) {
Index: src/librt/primitives/ebm/ebm.c
===================================================================
--- src/librt/primitives/ebm/ebm.c	(revision 71111)
+++ src/librt/primitives/ebm/ebm.c	(working copy)
@@ -162,7 +162,7 @@
     for (y = 0; y < eip->ydim; y++) {
 	for (x = 0; x < eip->xdim; x++) {
 	    if (BIT(eip, x, y) != 0) {
-		id = (y+BIT_YWIDEN)*(eip->xdim + BIT_XWIDEN*2)+x+BIT_XWIDEN; 
+		id = (y+BIT_YWIDEN)*(eip->xdim + BIT_XWIDEN*2)+x+BIT_XWIDEN;
 		args->apbuf[(id >> 3)] |= (1 << (id & 7));
 	    }
 	}
@@ -651,13 +651,13 @@
     nbytes = (eip->xdim+BIT_XWIDEN*2)*(eip->ydim+BIT_YWIDEN*2);
 
     /* If first use of this file, prepare in-memory buffer */
-    if (!mp->apbuf) {
+    if (!mp->have_apbuf) {
 	size_t y;
 	unsigned char *cp;
 
 	/* Prevent a multi-processor race */
 	bu_semaphore_acquire(RT_SEM_MODEL);
-	if (mp->apbuf) {
+	if (mp->have_apbuf) {
 	    /* someone else beat us, nothing more to do */
 	    bu_semaphore_release(RT_SEM_MODEL);
 	    return 0;
@@ -665,7 +665,12 @@
 	mp->apbuf = (void *)bu_calloc(
 	    1, nbytes, "rt_ebm_import4 bitmap");
 	mp->apbuflen = nbytes;
+	mp->have_apbuf = 1;
 
+	mp->tbl->apbuf[mp->idx] = mp->apbuf;
+	mp->tbl->apbuflen[mp->idx] = mp->apbuflen;
+	mp->tbl->have_apbuf[mp->idx] = mp->have_apbuf;
+
 	bu_semaphore_release(RT_SEM_MODEL);
 
 	/* Because of in-memory padding, read each scanline separately */
@@ -793,13 +798,13 @@
     nbytes = (eip->xdim+BIT_XWIDEN*2)*(eip->ydim+BIT_YWIDEN*2);
 
     /* If first use of this file, prepare in-memory buffer */
-    if (!mp->apbuf) {
+    if (!mp->have_apbuf) {
 	size_t y;
 	unsigned char *cp;
 
 	/* Prevent a multi-processor race */
 	bu_semaphore_acquire(RT_SEM_MODEL);
-	if (mp->apbuf) {
+	if (mp->have_apbuf) {
 	    /* someone else beat us, nothing more to do */
 	    bu_semaphore_release(RT_SEM_MODEL);
 	    return 0;
@@ -807,7 +812,12 @@
 	mp->apbuf = (void *)bu_calloc(
 	    1, nbytes, "rt_ebm_import4 bitmap");
 	mp->apbuflen = nbytes;
+	mp->have_apbuf = 1;
 
+	mp->tbl->apbuf[mp->idx] = mp->apbuf;
+	mp->tbl->apbuflen[mp->idx] = mp->apbuflen;
+	mp->tbl->have_apbuf[mp->idx] = mp->have_apbuf;
+
 	bu_semaphore_release(RT_SEM_MODEL);
 
 	/* Because of in-memory padding, read each scanline separately */
@@ -910,7 +920,6 @@
     RT_EBM_CK_MAGIC(eip);
 
     if (eip->mp) {
-	BU_CK_MAPPED_FILE(eip->mp);
 	bu_close_mapped_file(eip->mp);
     }
 
@@ -1137,7 +1146,6 @@
     register struct rt_ebm_specific *ebmp =
 	(struct rt_ebm_specific *)stp->st_specific;
 
-    BU_CK_MAPPED_FILE(ebmp->ebm_i.mp);
     bu_close_mapped_file(ebmp->ebm_i.mp);
 
     BU_PUT(ebmp, struct rt_ebm_specific);
Index: src/librt/primitives/hf/hf.c
===================================================================
--- src/librt/primitives/hf/hf.c	(revision 71111)
+++ src/librt/primitives/hf/hf.c	(working copy)
@@ -2196,7 +2196,6 @@
     xip->magic = 0;			/* sanity */
 
     if (xip->mp) {
-	BU_CK_MAPPED_FILE(xip->mp);
 	bu_close_mapped_file(xip->mp);
     }
 
