burp.h (Firebird-3.0.2.32703-0.tar.bz2) | : | burp.h (Firebird-3.0.4.33054-0.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 52 | skipping to change at line 52 | |||
#include "../../jrd/SimilarToMatcher.h" | #include "../../jrd/SimilarToMatcher.h" | |||
#ifdef HAVE_UNISTD_H | #ifdef HAVE_UNISTD_H | |||
#include <unistd.h> | #include <unistd.h> | |||
#endif | #endif | |||
#ifdef HAVE_FCNTL_H | #ifdef HAVE_FCNTL_H | |||
#include <fcntl.h> | #include <fcntl.h> | |||
#endif | #endif | |||
static inline UCHAR* BURP_alloc(ULONG size) | ||||
{ | ||||
return MISC_alloc_burp(size); | ||||
} | ||||
static inline UCHAR* BURP_alloc_zero(ULONG size) | ||||
{ | ||||
return MISC_alloc_burp(size); | ||||
} | ||||
static inline void BURP_free(void* block) | ||||
{ | ||||
MISC_free_burp(block); | ||||
} | ||||
const int GDS_NAME_LEN = METADATA_IDENTIFIER_CHAR_LEN * 4 /* max bytes p er char */ + 1; | const int GDS_NAME_LEN = METADATA_IDENTIFIER_CHAR_LEN * 4 /* max bytes p er char */ + 1; | |||
typedef TEXT GDS_NAME[GDS_NAME_LEN]; | typedef TEXT GDS_NAME[GDS_NAME_LEN]; | |||
enum redirect_vals { | enum redirect_vals { | |||
NOREDIRECT = 0, | NOREDIRECT = 0, | |||
REDIRECT = 1, | REDIRECT = 1, | |||
NOOUTPUT = 2 | NOOUTPUT = 2 | |||
}; | }; | |||
// Record types in backup file | // Record types in backup file | |||
skipping to change at line 892 | skipping to change at line 877 | |||
~UnicodeCollationHolder(); | ~UnicodeCollationHolder(); | |||
Jrd::TextType* getTextType() | Jrd::TextType* getTextType() | |||
{ | { | |||
return textType; | return textType; | |||
} | } | |||
}; | }; | |||
// Global switches and data | // Global switches and data | |||
class BurpGlobals : public Firebird::ThreadData | class GblPool | |||
{ | ||||
private: | ||||
// Moved it to separate class in order to ensure 'first create/last destr | ||||
oy' order | ||||
Firebird::MemoryPool* gbl_pool; | ||||
public: | ||||
Firebird::MemoryPool& getPool() | ||||
{ | ||||
fb_assert(gbl_pool); | ||||
return *gbl_pool; | ||||
} | ||||
explicit GblPool(bool ownPool) | ||||
: gbl_pool(ownPool ? MemoryPool::createPool(getDefaultMemoryPool( | ||||
)) : getDefaultMemoryPool()) | ||||
{ } | ||||
~GblPool() | ||||
{ | ||||
if (gbl_pool != getDefaultMemoryPool()) | ||||
Firebird::MemoryPool::deletePool(gbl_pool); | ||||
} | ||||
}; | ||||
class BurpGlobals : public Firebird::ThreadData, public GblPool | ||||
{ | { | |||
public: | public: | |||
explicit BurpGlobals(Firebird::UtilSvc* us) | explicit BurpGlobals(Firebird::UtilSvc* us) | |||
: ThreadData(ThreadData::tddGBL), | : ThreadData(ThreadData::tddGBL), | |||
defaultCollations(*getDefaultMemoryPool()), | GblPool(us->isService()), | |||
defaultCollations(getPool()), | ||||
uSvc(us), | uSvc(us), | |||
verboseInterval(10000), | verboseInterval(10000), | |||
flag_on_line(true), | flag_on_line(true), | |||
firstMap(true), | firstMap(true), | |||
stdIoMode(false) | stdIoMode(false) | |||
{ | { | |||
// this is VERY dirty hack to keep current behaviour | // this is VERY dirty hack to keep current behaviour | |||
memset (&gbl_database_file_name, 0, | memset (&gbl_database_file_name, 0, | |||
&veryEnd - reinterpret_cast<char*>(&gbl_database_file_nam e)); | &veryEnd - reinterpret_cast<char*>(&gbl_database_file_nam e)); | |||
memset(status_vector, 0, sizeof(status_vector)); | ||||
// normal code follows | ||||
gbl_stat_flags = 0; | gbl_stat_flags = 0; | |||
gbl_stat_header = false; | gbl_stat_header = false; | |||
gbl_stat_done = false; | gbl_stat_done = false; | |||
memset(gbl_stats, 0, sizeof(gbl_stats)); | memset(gbl_stats, 0, sizeof(gbl_stats)); | |||
gbl_stats[TIME_TOTAL] = gbl_stats[TIME_DELTA] = fb_utils::query_p erformance_counter(); | gbl_stats[TIME_TOTAL] = gbl_stats[TIME_DELTA] = fb_utils::query_p erformance_counter(); | |||
// normal code follows | ||||
exit_code = FINI_ERROR; // prevent FINI_OK in case of unknown err or thrown | exit_code = FINI_ERROR; // prevent FINI_OK in case of unknown err or thrown | |||
// would be set t o FINI_OK (==0) in exit_local | // would be set t o FINI_OK (==0) in exit_local | |||
} | } | |||
const TEXT* gbl_database_file_name; | const TEXT* gbl_database_file_name; | |||
TEXT gbl_backup_start_time[30]; | TEXT gbl_backup_start_time[30]; | |||
bool gbl_sw_verbose; | bool gbl_sw_verbose; | |||
bool gbl_sw_ignore_limbo; | bool gbl_sw_ignore_limbo; | |||
bool gbl_sw_meta; | bool gbl_sw_meta; | |||
bool gbl_sw_novalidity; | bool gbl_sw_novalidity; | |||
skipping to change at line 1140 | skipping to change at line 1148 | |||
msgVerbose_write_collations = 212, | msgVerbose_write_collations = 212, | |||
msgErr_restore_charset = 213, | msgErr_restore_charset = 213, | |||
msgVerbose_restore_charset = 214, | msgVerbose_restore_charset = 214, | |||
msgErr_restore_collation = 215, | msgErr_restore_collation = 215, | |||
msgVerbose_restore_collation = 216 | msgVerbose_restore_collation = 216 | |||
}; | }; | |||
// BLOB buffer | // BLOB buffer | |||
typedef Firebird::HalfStaticArray<UCHAR, 1024> BlobBuffer; | typedef Firebird::HalfStaticArray<UCHAR, 1024> BlobBuffer; | |||
static inline UCHAR* BURP_alloc(ULONG size) | ||||
{ | ||||
BurpGlobals* tdgbl = BurpGlobals::getSpecific(); | ||||
return (UCHAR*)(tdgbl->getPool().allocate(size ALLOC_ARGS)); | ||||
} | ||||
static inline UCHAR* BURP_alloc_zero(ULONG size) | ||||
{ | ||||
BurpGlobals* tdgbl = BurpGlobals::getSpecific(); | ||||
return (UCHAR*)(tdgbl->getPool().calloc(size ALLOC_ARGS)); | ||||
} | ||||
static inline void BURP_free(void* block) | ||||
{ | ||||
MemoryPool::globalFree(block); | ||||
} | ||||
#endif // BURP_BURP_H | #endif // BURP_BURP_H | |||
End of changes. 7 change blocks. | ||||
19 lines changed or deleted | 46 lines changed or added |