| 899 | } |
| 900 | |
| 901 | BackupManager::BackupManager(thread_db* tdbb, Database* _database, int ini_state) : |
| 902 | dbCreating(false), database(_database), diff_file(NULL), alloc_table(NULL), |
| 903 | last_allocated_page(0), temp_buffers_space(*database->dbb_permanent), |
| 904 | current_scn(0), diff_name(*database->dbb_permanent), |
| 905 | explicit_diff_name(false), flushInProgress(false), shutDown(false), allocIsValid(false), |
| 906 | master(false), stateBlocking(false), |
| 907 | stateLock(FB_NEW_POOL(*database->dbb_permanent) NBackupStateLock(tdbb, *database->dbb_permanent, this)), |
| 908 | allocLock(FB_NEW_POOL(*database->dbb_permanent) NBackupAllocLock(tdbb, *database->dbb_permanent, this)) |
| 909 | { |
| 910 | // Allocate various database page buffers needed for operation |
| 911 | // Align it at sector boundary for faster IO (also guarantees correct alignment for ULONG later) |
| 912 | UCHAR* temp_buffers = reinterpret_cast<UCHAR*> |
| 913 | (temp_buffers_space.getAlignedBuffer(database->dbb_page_size * 3, database->getIOBlockSize())); |
| 914 | |
| 915 | memset(temp_buffers, 0, database->dbb_page_size * 3); |
| 916 | |
| 917 | backup_state = ini_state; |
| 918 | |
| 919 | empty_buffer = reinterpret_cast<ULONG*>(temp_buffers); |
| 920 | spare_buffer = reinterpret_cast<ULONG*>(temp_buffers + database->dbb_page_size); |
| 921 | alloc_buffer = reinterpret_cast<ULONG*>(temp_buffers + database->dbb_page_size * 2); |
| 922 | |
| 923 | NBAK_TRACE(("Create BackupManager, database=%s", database->dbb_filename.c_str())); |
| 924 | } |
| 925 | |
| 926 | BackupManager::~BackupManager() |
| 927 | { |
nothing calls this directly
no test coverage detected