mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 08:03:04 +01:00
Misc
This commit is contained in:
parent
d792faaf49
commit
96a6ad5863
@ -4612,4 +4612,3 @@ static processing_state show_users()
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -525,7 +525,7 @@ USHORT PIO_init_data(Database* dbb, jrd_file* main_file, ISC_STATUS* status_vect
|
||||
// we need a class here only to return memory on shutdown and avoid
|
||||
// false memory leak reports
|
||||
static Firebird::Array<char> zero_array(*getDefaultMemoryPool());
|
||||
static char *zero_buff = NULL;
|
||||
static char* zero_buff = NULL;
|
||||
const int zero_buf_size = 1024 * 128;
|
||||
if (!zero_buff)
|
||||
{
|
||||
@ -559,7 +559,8 @@ USHORT PIO_init_data(Database* dbb, jrd_file* main_file, ISC_STATUS* status_vect
|
||||
if (write_pages > leftPages)
|
||||
write_pages = leftPages;
|
||||
|
||||
SLONG to_write = write_pages * dbb->dbb_page_size, written;
|
||||
SLONG to_write = write_pages * dbb->dbb_page_size;
|
||||
SLONG written;
|
||||
|
||||
{
|
||||
for (int r = 0; r < IO_RETRY; r++)
|
||||
@ -586,6 +587,7 @@ USHORT PIO_init_data(Database* dbb, jrd_file* main_file, ISC_STATUS* status_vect
|
||||
leftPages -= write_pages;
|
||||
i += write_pages;
|
||||
}
|
||||
|
||||
return (initPages - leftPages);
|
||||
***/
|
||||
}
|
||||
@ -1311,4 +1313,3 @@ static int raw_devices_unlink_database (
|
||||
return 0;
|
||||
}
|
||||
#endif // SUPPORT_RAW_DEVICES
|
||||
|
||||
|
@ -110,7 +110,7 @@ void FileExtendLock::release(thread_db* tdbb, bool exclusive)
|
||||
class FileExtendLockGuard
|
||||
{
|
||||
public:
|
||||
FileExtendLockGuard(thread_db* tdbb, FileExtendLock *lock, bool exclusive) :
|
||||
FileExtendLockGuard(thread_db* tdbb, FileExtendLock* lock, bool exclusive) :
|
||||
m_tdbb(tdbb), m_lock(lock), m_exclusive(exclusive)
|
||||
{
|
||||
if (exclusive) {
|
||||
@ -364,7 +364,7 @@ void PIO_extend(jrd_file* main_file, const ULONG extPages, const USHORT pageSize
|
||||
LARGE_INTEGER newSize;
|
||||
newSize.QuadPart = (ULONGLONG) (filePages + extendBy) * pageSize;
|
||||
|
||||
if (ostype == OS_CHICAGO) {
|
||||
if (ostype == OS_CHICAGO) { // WIN95
|
||||
file->fil_mutex.enter();
|
||||
}
|
||||
|
||||
@ -385,6 +385,7 @@ void PIO_extend(jrd_file* main_file, const ULONG extPages, const USHORT pageSize
|
||||
if (ostype == OS_CHICAGO) {
|
||||
file->fil_mutex.leave();
|
||||
}
|
||||
|
||||
leftPages -= extendBy;
|
||||
}
|
||||
}
|
||||
@ -591,7 +592,7 @@ USHORT PIO_init_data(Database* dbb, jrd_file* main_file, ISC_STATUS* status_vect
|
||||
// we need a class here only to return memory on shutdown and avoid
|
||||
// false memory leak reports
|
||||
static Firebird::Array<char> zero_array(*getDefaultMemoryPool());
|
||||
static char *zero_buff = NULL;
|
||||
static char* zero_buff = NULL;
|
||||
const int zero_buf_size = 1024 * 128;
|
||||
if (!zero_buff)
|
||||
{
|
||||
@ -608,7 +609,8 @@ USHORT PIO_init_data(Database* dbb, jrd_file* main_file, ISC_STATUS* status_vect
|
||||
bdb.bdb_dbb = dbb;
|
||||
bdb.bdb_page = PageNumber(0, startPage);
|
||||
|
||||
OVERLAPPED overlapped, *overlapped_ptr;
|
||||
OVERLAPPED overlapped;
|
||||
OVERLAPPED* overlapped_ptr;
|
||||
jrd_file* file =
|
||||
seek_file(main_file, &bdb, status_vector, &overlapped, &overlapped_ptr);
|
||||
|
||||
@ -632,7 +634,8 @@ USHORT PIO_init_data(Database* dbb, jrd_file* main_file, ISC_STATUS* status_vect
|
||||
|
||||
seek_file(main_file, &bdb, status_vector, &overlapped, &overlapped_ptr);
|
||||
|
||||
DWORD to_write = (DWORD) write_pages * dbb->dbb_page_size, written;
|
||||
DWORD to_write = (DWORD) write_pages * dbb->dbb_page_size;
|
||||
DWORD written;
|
||||
|
||||
if (!WriteFile(file->fil_desc, zero_buff, to_write, &written, overlapped_ptr) ||
|
||||
to_write != written)
|
||||
@ -650,6 +653,7 @@ USHORT PIO_init_data(Database* dbb, jrd_file* main_file, ISC_STATUS* status_vect
|
||||
leftPages -= write_pages;
|
||||
i += write_pages;
|
||||
}
|
||||
|
||||
return (initPages - leftPages);
|
||||
}
|
||||
|
||||
@ -1351,4 +1355,3 @@ static bool nt_error(TEXT* string,
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -851,6 +851,7 @@ PAG PAG_allocate(WIN * window)
|
||||
}
|
||||
fb_assert(new_page);
|
||||
}
|
||||
|
||||
if (!(dbb->dbb_flags & DBB_no_reserve))
|
||||
{
|
||||
const ULONG initialized =
|
||||
@ -858,7 +859,7 @@ PAG PAG_allocate(WIN * window)
|
||||
|
||||
// At this point we ensure database has at least "initialized" pages
|
||||
// allocated. To avoid file growth by few pages when all this space
|
||||
// will be used extend file up to initialized + next_init_pages now
|
||||
// will be used, extend file up to initialized + next_init_pages now
|
||||
pageSpace->extend(tdbb, initialized + next_init_pages);
|
||||
}
|
||||
}
|
||||
@ -2420,10 +2421,12 @@ void PageManager::closeAll()
|
||||
void PageManager::releaseLocks()
|
||||
{
|
||||
for (size_t i = 0; i < pageSpaces.getCount(); i++)
|
||||
{
|
||||
if (pageSpaces[i]->file && pageSpaces[i]->file->fil_ext_lock) {
|
||||
delete pageSpaces[i]->file->fil_ext_lock;
|
||||
pageSpaces[i]->file->fil_ext_lock = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
USHORT PageManager::getTempPageSpaceID(thread_db* tdbb)
|
||||
|
Loading…
Reference in New Issue
Block a user