reuse the pages from the segmentinfolist
when getBlock is given a specific size (for the segmentinfolist, for example), if the head of the freeBlocks list is big enough, use it, possibly returning a remainder to the freeBlocks list.
calculate initial list of free blocks when the file is first opened.  also, coalesce adjacent blocks in the free block list.
notes
notes
notes
expose bool property to allow AutoMerge to be turned off.  add a test case (and a temporary sleep call) to expose race condition bug.
notes
add a bit more locking to fix a race condition.  while constructing a multicursor (for db.OpenCursor or for a merge), we don't want any segment getting added to the freeBlocks list after we start getting cursors and before we place an entry in the cursors map (which is basically the list of read locks for segments).  so lock critSectionCursors around the getCursor calls for a multicursor, and around the spot where we check the cursors map to see if we can call addFreeBlocks.  also changed the stomp code to use its own file handle.  and tweaked the way we call the cursor hook within dispose (not on finalize).  and in checkForMerge, when we get segmentsOfAge, use a snapshot of the header rather than access header directly in the lambda.  the header can change during the List.filter call.  also commented out the temporary Sleep call.  and added a reference from tapp to dbTests so that tapp can just call test cases directly.
notes
remove OpenSegment
call fnFree (which is really checkForGoneSegment) within the critSectionCursors lock, rather than having it re-lock the same thing.  and only call it when the cursor has just been removed, so it doesn't have to do the check itself.  all it does is check to see if the guid is in header.segments.  the only reason this is a hook passed in is because if getCursor were opening a cursor on a segment in waiting, the hook would be None.