Check-in [b44f224092]

Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

SHA1 Hash:b44f224092e63f367590e5b8d400e0ed25a0bf60
Date: 2010-03-10 21:09:12
User: stephan
Comment:minor code reorg.

Tags And Properties
Changes
[hide diffs]

Changes to pfs/EPFSApp.c

@@ -23,32 +23,39 @@
 #include <assert.h>
 #include <stdlib.h> // free()
 #include <string.h> // strcmp()
 #include <stdio.h>
 
+#define USE_ALLOCATOR 1 /* set to 1 to enable mempool support. */
 enum {
 /**
    Statically-assigned size of whio_epfs memory pool for EPFS.
 */
 AllocatorSize =
-4000 // only a very large EFS with lots of opened records, or large pseudofiles with small block sizes, would need this much.
-//2000 // has worked for me so far (famous last words)
+#if USE_ALLOCATOR
+//4000 // only a very large EFS with lots of opened records, or large pseudofiles with small block sizes, would need this much.
+2000 // has worked for me so far (famous last words)
 //500 // works for small use cases on 32-bit, but not 64-bit. Good for testing allocation failure.
-//0 // uses stdlib allocators
+#else
+0 // uses stdlib allocators
+#endif
 ,
 /**
-   Statically-assigned size of whio_alloc() memory pool.
+   Statically-assigned size of whio_malloc() memory pool.
 
    Due to static destruction ordering and our use of atexit(), we have
    to be very careful with this option. i was at one point getting
    memory corruption because the deallocator was statically destructed
    before the EPFSApp.dev device was. It showed up as an assertion in
    libc during fclose() (via whio_dev::close()).
 */
 WhioPoolSize =
+#if USE_ALLOCATOR
 500 /* should be more than plenty */
-//0 // uses stdlib allocators
+#else
+0 // uses stdlib allocators
+#endif
 
 };
 enum ArgSpecTypes {
 ArgTypeIgnore = 0,
 ArgTypeIOSizeT,