Skip to content

Commit

Permalink
Fixed bug CORE-2184 : Bus error on SPARC
Browse files Browse the repository at this point in the history
  • Loading branch information
hvlad committed Jan 19, 2010
1 parent 652bef8 commit 577a3b8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/jrd/TempSpace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ using Firebird::TempFile;

// Static definitions/initializations

const size_t MIN_TEMP_BLOCK_SIZE = 64 * 1024;

Firebird::GlobalPtr<Firebird::Mutex> TempSpace::initMutex;
Firebird::TempDirectoryList* TempSpace::tempDirs = NULL;
size_t TempSpace::minBlockSize = 0;
Expand Down Expand Up @@ -149,6 +151,11 @@ TempSpace::TempSpace(MemoryPool& p, const Firebird::PathName& prefix)
MemoryPool& def_pool = *getDefaultMemoryPool();
tempDirs = FB_NEW(def_pool) Firebird::TempDirectoryList(def_pool);
minBlockSize = Config::getTempBlockSize();

if (minBlockSize < MIN_TEMP_BLOCK_SIZE)
minBlockSize = MIN_TEMP_BLOCK_SIZE;
else
minBlockSize = FB_ALIGN(minBlockSize, MIN_TEMP_BLOCK_SIZE);
}
}
}
Expand Down Expand Up @@ -596,6 +603,7 @@ size_t TempSpace::allocateBatch(size_t count, size_t minSize, size_t maxSize, Se
freeMem = MIN(freeMem / count, maxSize);
freeMem = MAX(freeMem, minSize);
freeMem = MIN(freeMem, minBlockSize);
freeMem &= ~(FB_ALIGNMENT - 1);

Segment** prevSpace = &freeSegments;
freeSpace = freeSegments;
Expand Down

0 comments on commit 577a3b8

Please sign in to comment.