/* -*- mode: C; c-basic-offset: 4 -*- */ #ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved." #include #include #include #include #include static inline size_t resize(size_t n) { if (n >= 1*1024*1024) n = (n+7) & ~7; // round up to make windbg !heap happy #define DO_PAD_64K 0 #if DO_PAD_64K else if (64*1024 <= n && n < 1*1024*1024) n = 1*1024*1024; // map anything >= 64K to 1M #endif #define DO_ROUND_POW2 1 #if DO_ROUND_POW2 else { // make all buffers a power of 2 in size including the windows overhead size_t r = 0; size_t newn = 1< newn) { r++; newn = 1<