diff --git a/src/alice/alice_meta.epp b/src/alice/alice_meta.epp index 9531fc791e..4b48debd64 100644 --- a/src/alice/alice_meta.epp +++ b/src/alice/alice_meta.epp @@ -27,7 +27,7 @@ * *____________________________________________________________ * - * $Id: alice_meta.epp,v 1.5 2002-04-04 05:31:13 bellardo Exp $ + * $Id: alice_meta.epp,v 1.6 2002-09-25 17:12:00 skidder Exp $ */ #include "firebird.h" @@ -245,7 +245,7 @@ static STR alloc_string(TEXT ** ptr) p = *ptr; length = (USHORT) * p++; - string = new(*tdgbl->ALICE_default_pool, length + 1) str; + string = FB_NEW_RPT(*tdgbl->ALICE_default_pool, length + 1) str; q = (TEXT *) string->str_data; while (length--) @@ -342,9 +342,9 @@ static TDR get_description(SLONG blob_id[2]) id = gds__vax_integer((UCHAR*) p, id_length); p += id_length; if (!trans) - trans = ptr = new(*tdgbl->ALICE_default_pool) tdr; + trans = ptr = FB_NEW(*tdgbl->ALICE_default_pool) tdr; else { - ptr->tdr_next = new(*tdgbl->ALICE_default_pool) tdr; + ptr->tdr_next = FB_NEW(*tdgbl->ALICE_default_pool) tdr; ptr = ptr->tdr_next; } ptr->tdr_host_site = host_site; @@ -405,7 +405,7 @@ static void parse_fullpath(TDR trans) if (*q) { trans->tdr_filename = q + 1; - trans->tdr_remote_site = new(*tdgbl->ALICE_default_pool, q - p + 1) str; + trans->tdr_remote_site = FB_NEW_RPT(*tdgbl->ALICE_default_pool, q - p + 1) str; strncpy((char*) trans->tdr_remote_site->str_data, (char*) p, q - p); trans->tdr_remote_site->str_data[q - p] = '\0'; } @@ -431,7 +431,7 @@ static void parse_fullpath(TDR trans) p++; if (length) { - trans->tdr_remote_site = new(*tdgbl->ALICE_default_pool, length + 1) str; + trans->tdr_remote_site = FB_NEW_RPT(*tdgbl->ALICE_default_pool, length + 1) str; q = (TEXT *) trans->tdr_remote_site->str_data; while (length--) *q++ = *p++; diff --git a/src/alice/all.cpp b/src/alice/all.cpp index 33a717f846..631867ce6b 100644 --- a/src/alice/all.cpp +++ b/src/alice/all.cpp @@ -24,7 +24,7 @@ // //____________________________________________________________ // -// $Id: all.cpp,v 1.5 2001-12-29 10:08:21 tamlin Exp $ +// $Id: all.cpp,v 1.6 2002-09-25 17:12:00 skidder Exp $ // #include "../alice/all.h" @@ -80,7 +80,7 @@ void ALLA_init(void) AliceMemoryPool::create_new_pool(); #else // TMN: John, what pool to use here? - tdgbl->ALICE_permanent_pool = new (*getDefaultMemoryPool()) AliceMemoryPool; + tdgbl->ALICE_permanent_pool = FB_NEW(*getDefaultMemoryPool()) AliceMemoryPool; tdgbl->ALICE_default_pool = tdgbl->ALICE_permanent_pool; #endif } diff --git a/src/alice/tdr.cpp b/src/alice/tdr.cpp index 4ef0831172..fc674c6771 100644 --- a/src/alice/tdr.cpp +++ b/src/alice/tdr.cpp @@ -24,7 +24,7 @@ // //____________________________________________________________ // -// $Id: tdr.cpp,v 1.7 2002-03-11 16:34:00 skywalker Exp $ +// $Id: tdr.cpp,v 1.8 2002-09-25 17:12:00 skidder Exp $ // // 2002.02.15 Sean Leyne - Code Cleanup, removed obsolete "Apollo" port // @@ -926,7 +926,7 @@ static void reattach_database(TDR trans) trans, reinterpret_cast(p))) { - string = new(*tdgbl->ALICE_default_pool, + string = FB_NEW_RPT(*tdgbl->ALICE_default_pool, strlen(reinterpret_cast(p)) + 1) str; strcpy(reinterpret_cast(string->str_data), reinterpret_cast(p)); diff --git a/src/common/memory/allocators.cpp b/src/common/memory/allocators.cpp index 2fc43310b7..eab13585c3 100644 --- a/src/common/memory/allocators.cpp +++ b/src/common/memory/allocators.cpp @@ -95,7 +95,7 @@ void* API_ROUTINE gds__alloc(SLONG size_request) try { poolLoader.loadPool(); - return FB_MemoryPool->allocate(size_request); + return FB_MemoryPool->allocate(size_request,0); } catch(...) {} return 0; @@ -144,7 +144,11 @@ void* operator new(size_t s) } #endif // DEV_BUILD poolLoader.loadPool(); - return FB_MemoryPool->allocate(s); + return FB_MemoryPool->allocate(s,0 +#ifdef DEBUG_GDS_ALLOC + ,__FILE__,__LINE__ +#endif + ); } /** operator new[] implementation to trap all calls to the default operator @@ -164,16 +168,14 @@ void* operator new[](size_t s) } #endif poolLoader.loadPool(); - return FB_MemoryPool->allocate(s); + return FB_MemoryPool->allocate(s,0 +#ifdef DEBUG_GDS_ALLOC + ,__FILE__,__LINE__ +#endif + ); } -/** Generic operator new to allocate memory from a given pool. Works with - all objects that don't define their own operator new. -**/ -void* operator new(size_t s, MemoryPool& p) -{ - return p.allocate(s, 0); -} + /** operator delete to handle exceptions thrown while contructing object with our custom operator new. @@ -219,14 +221,6 @@ void* operator new(size_t s, MemoryPool* p) } #endif -/** Generic operator new to allocate memory from a given pool. Works with - all objects that don't define their own operator new. -**/ -void* operator new[](size_t s, MemoryPool& p) -{ - return p.allocate(s, 0); -} - #ifdef DEBUG_GDS_ALLOC // Debugging operators new used by FB_NEW macro. Work the same as the above @@ -241,6 +235,24 @@ void* operator new[](size_t s, MemoryPool& p, char *file, int line) return p.allocate(s, 0, file, line); } +#else + +/** Generic operator new to allocate memory from a given pool. Works with + all objects that don't define their own operator new. +**/ +void* operator new(size_t s, MemoryPool& p) +{ + return p.allocate(s, 0); +} + +/** Generic operator new to allocate memory from a given pool. Works with + all objects that don't define their own operator new. +**/ +void* operator new[](size_t s, MemoryPool& p) +{ + return p.allocate(s, 0); +} + #endif /** operator delete[] to handle exceptions thrown while contructing object with diff --git a/src/common/memory/allocators.h b/src/common/memory/allocators.h index 03e4a0d219..c0eb719993 100644 --- a/src/common/memory/allocators.h +++ b/src/common/memory/allocators.h @@ -46,17 +46,19 @@ extern ULONG API_ROUTINE gds__free(void* blk); void* operator new(size_t); void* operator new[](size_t); -FB_DLL_EXPORT void* operator new(size_t, MemoryPool&); FB_DLL_EXPORT void operator delete(void* mem, MemoryPool&); -FB_DLL_EXPORT void* operator new[](size_t s, MemoryPool&); FB_DLL_EXPORT void operator delete[](void* mem, MemoryPool&); #ifdef DEBUG_GDS_ALLOC FB_DLL_EXPORT void* operator new(size_t, MemoryPool&, char*, int); FB_DLL_EXPORT void* operator new[](size_t s, MemoryPool&, char*, int); #define FB_NEW(pool) new(pool,__FILE__,__LINE__) +#define FB_NEW_RPT(pool,count) new(pool,count,__FILE__,__LINE__) #else +FB_DLL_EXPORT void* operator new(size_t, MemoryPool&); +FB_DLL_EXPORT void* operator new[](size_t s, MemoryPool&); #define FB_NEW(pool) new(pool) +#define FB_NEW_RPT(pool,count) new(pool,count) #endif FB_DLL_EXPORT void* operator new(size_t, MemoryPool*); @@ -113,10 +115,18 @@ namespace Firebird allocator(const allocator &alloc) : pool(alloc.getPool()), type(alloc.getType()) { } +#ifdef DEBUG_GDS_ALLOC pointer allocate(size_type s, const void * = 0) - { return (pointer) (pool ? pool->allocate(sizeof(T) * s) : gds__alloc(sizeof(T)*s)); } + { return (pointer) (pool ? pool->allocate(sizeof(T) * s, 0,__FILE__, __LINE__) : gds__alloc(sizeof(T)*s)); } char *_Charalloc(size_type n) - { return (char*) (pool ? pool->allocate(n) : gds__alloc(n)); } + { return (char*) (pool ? pool->allocate(n, 0, __FILE__, __LINE__) : gds__alloc(n)); } +#else + pointer allocate(size_type s, const void * = 0) + { return (pointer) (pool ? pool->allocate(sizeof(T) * s, 0) : gds__alloc(sizeof(T)*s)); } + char *_Charalloc(size_type n) + { return (char*) (pool ? pool->allocate(n, 0) : gds__alloc(n)); } +#endif + void deallocate(pointer p, size_type s) { if (pool) MemoryPool::deallocate(p); else gds__free(p); } void deallocate(void* p, size_type s) diff --git a/src/common/memory/memory_pool.h b/src/common/memory/memory_pool.h index d624d705ea..7e0fc6d061 100644 --- a/src/common/memory/memory_pool.h +++ b/src/common/memory/memory_pool.h @@ -96,9 +96,9 @@ public: /// Allocates at least the given number of bytes from the pool and /// returns a pointer to the memory. #ifdef DEBUG_GDS_ALLOC - void* allocate(size_t, short = 0, char* = NULL, int = 0); + void* allocate(size_t, short, char*, int); #else - void* allocate(size_t, short = 0); + void* allocate(size_t, short); #endif /// Deallocates memory that has been allocated from ANY MemoryPool. diff --git a/src/dsql/alld.cpp b/src/dsql/alld.cpp index a4a91adfa2..a6b42a561f 100644 --- a/src/dsql/alld.cpp +++ b/src/dsql/alld.cpp @@ -113,8 +113,8 @@ void ALLD_init() if (!init_flag) { init_flag = true; - DSQL_permanent_pool = new(*getDefaultMemoryPool()) DsqlMemoryPool; - pools = new(*DSQL_permanent_pool) Firebird::vector + DSQL_permanent_pool = FB_NEW(*getDefaultMemoryPool()) DsqlMemoryPool; + pools = FB_NEW(*DSQL_permanent_pool) Firebird::vector (10, *DSQL_permanent_pool, dsql_type_vec); tdsql->tsql_default = DSQL_permanent_pool; } diff --git a/src/dsql/ddl.cpp b/src/dsql/ddl.cpp index 42ee0ebc13..98f84e680c 100644 --- a/src/dsql/ddl.cpp +++ b/src/dsql/ddl.cpp @@ -20,7 +20,7 @@ * All Rights Reserved. * Contributor(s): ______________________________________. * - * $Id: ddl.cpp,v 1.18 2002-09-12 19:53:44 skidder Exp $ + * $Id: ddl.cpp,v 1.19 2002-09-25 17:12:05 skidder Exp $ * 2001.5.20 Claudio Valderrama: Stop null pointer that leads to a crash, * caused by incomplete yacc syntax that allows ALTER DOMAIN dom SET; * @@ -2346,7 +2346,7 @@ static void define_procedure( REQ request, NOD_TYPE op) } /* Fill req_procedure to allow procedure to self reference */ - procedure = new(*tdsql->tsql_default, + procedure = FB_NEW_RPT(*tdsql->tsql_default, strlen(reinterpret_cast(procedure_name->str_data))) prc; procedure->prc_name = procedure->prc_data; procedure->prc_owner = @@ -2808,7 +2808,7 @@ static void define_trigger( REQ request, NOD node) gds_random, gds_arg_string, trigger_name->str_data, 0); } - relation_node = new(*tdsql->tsql_default, e_rln_count) nod; + relation_node = FB_NEW_RPT(*tdsql->tsql_default, e_rln_count) nod; node->nod_arg[e_trg_table] = relation_node; relation_node->nod_type = nod_relation_name; relation_node->nod_count = e_rln_count; @@ -3739,7 +3739,7 @@ static void define_view_trigger( REQ request, NOD node, NOD rse, NOD items) stack = request->req_context; context = (CTX) stack->lls_object; if (context->ctx_alias) { - sav_context = new(*tdsql->tsql_default) ctx; + sav_context = FB_NEW(*tdsql->tsql_default) ctx; *sav_context = *context; } } @@ -5724,7 +5724,7 @@ static void save_field(REQ request, TEXT* field_name) return; } - FLD field = new(*tdsql->tsql_default, strlen(field_name) + 1) fld; + FLD field = FB_NEW_RPT(*tdsql->tsql_default, strlen(field_name) + 1) fld; strcpy(field->fld_name, field_name); field->fld_next = relation->rel_fields; relation->rel_fields = field; @@ -5764,7 +5764,7 @@ static void save_relation( REQ request, STR relation_name) } else { - relation = new(*tdsql->tsql_default, relation_name->str_length) dsql_rel; + relation = FB_NEW_RPT(*tdsql->tsql_default, relation_name->str_length) dsql_rel; relation->rel_name = relation->rel_data; relation->rel_owner = relation->rel_data + relation_name->str_length + 1; diff --git a/src/dsql/dsql.cpp b/src/dsql/dsql.cpp index 03b18a5aef..7576a465af 100644 --- a/src/dsql/dsql.cpp +++ b/src/dsql/dsql.cpp @@ -29,7 +29,7 @@ * */ /* -$Id: dsql.cpp,v 1.22 2002-09-17 05:58:34 eku Exp $ +$Id: dsql.cpp,v 1.23 2002-09-25 17:12:06 skidder Exp $ */ /************************************************************** V4 Multi-threading changes. @@ -491,11 +491,11 @@ GDS_DSQL_ALLOCATE_CPP( STATUS* user_status, database = init((SLONG **) db_handle); - tdsql->tsql_default = new(*DSQL_permanent_pool) DsqlMemoryPool; + tdsql->tsql_default = FB_NEW(*DSQL_permanent_pool) DsqlMemoryPool; /* allocate the request block */ - request = new(*tdsql->tsql_default) req; + request = FB_NEW(*tdsql->tsql_default) req; request->req_dbb = database; request->req_pool = tdsql->tsql_default; @@ -613,7 +613,7 @@ STATUS DLL_EXPORT GDS_DSQL_EXECUTE_CPP(STATUS* user_status, ((request-> req_type == REQ_EMBED_SELECT) ? REQ_embedded_sql_cursor : 0); - request->req_open_cursor = open_cursor = new(*DSQL_permanent_pool) opn; + request->req_open_cursor = open_cursor = FB_NEW(*DSQL_permanent_pool) opn; open_cursor->opn_request = request; open_cursor->opn_transaction = (SLONG *) * trans_handle; THD_MUTEX_LOCK(&cursors_mutex); @@ -685,11 +685,11 @@ static STATUS dsql8_execute_immediate_common(STATUS* user_status, database = init(reinterpret_cast < long **>(db_handle)); - tdsql->tsql_default = new(*DSQL_permanent_pool) DsqlMemoryPool; + tdsql->tsql_default = FB_NEW(*DSQL_permanent_pool) DsqlMemoryPool; /* allocate the request block, then prepare the request */ - request = new(*tdsql->tsql_default) req; + request = FB_NEW(*tdsql->tsql_default) req; request->req_dbb = database; request->req_pool = tdsql->tsql_default; request->req_trans = (int *) *trans_handle; @@ -1341,8 +1341,8 @@ STATUS GDS_DSQL_PREPARE_CPP(STATUS* user_status, /* Because that's the client's allocated statement handle and we don't want to trash the context in it -- 2001-Oct-27 Ann Harrison */ - tdsql->tsql_default = new(*DSQL_permanent_pool) DsqlMemoryPool; - request = new(*tdsql->tsql_default) req; + tdsql->tsql_default = FB_NEW(*DSQL_permanent_pool) DsqlMemoryPool; + request = FB_NEW(*tdsql->tsql_default) req; request->req_dbb = database; request->req_pool = tdsql->tsql_default; request->req_trans = (int *) *trans_handle; @@ -3667,8 +3667,8 @@ static DBB init( SLONG ** db_handle) } } - pool = new(*DSQL_permanent_pool) DsqlMemoryPool; - database = new(*pool) dbb; + pool = FB_NEW(*DSQL_permanent_pool) DsqlMemoryPool; + database = FB_NEW(*pool) dbb; database->dbb_pool = pool; database->dbb_next = databases; databases = database; @@ -4122,8 +4122,8 @@ static REQ prepare( /* allocate the send and receive messages */ - request->req_send = new(*tdsql->tsql_default) msg; - request->req_receive = message = new(*tdsql->tsql_default) msg; + request->req_send = FB_NEW(*tdsql->tsql_default) msg; + request->req_receive = message = FB_NEW(*tdsql->tsql_default) msg; message->msg_number = 1; #ifdef SCROLLABLE_CURSORS @@ -4131,7 +4131,7 @@ static REQ prepare( /* allocate a message in which to send scrolling information outside of the normal send/receive protocol */ - request->req_async = message = new(*tdsql->tsql_default) msg; + request->req_async = message = FB_NEW(*tdsql->tsql_default) msg; message->msg_number = 2; } #endif @@ -4180,13 +4180,13 @@ static REQ prepare( request->req_type == REQ_EXEC_PROCEDURE) { /* Allocate persistent blr string from request's pool. */ - request->req_blr_string = new(*tdsql->tsql_default, 980) str; + request->req_blr_string = FB_NEW_RPT(*tdsql->tsql_default, 980) str; } else { /* Allocate transient blr string from permanent pool so as not to unnecessarily bloat the request's pool. */ - request->req_blr_string = new(*DSQL_permanent_pool, 980) str; + request->req_blr_string = FB_NEW_RPT(*DSQL_permanent_pool, 980) str; } request->req_blr_string->str_length = 980; request->req_blr = request->req_blr_string->str_data; diff --git a/src/dsql/gen.cpp b/src/dsql/gen.cpp index 65ff3a9684..913a77bc15 100644 --- a/src/dsql/gen.cpp +++ b/src/dsql/gen.cpp @@ -25,7 +25,7 @@ * */ /* -$Id: gen.cpp,v 1.10 2002-09-10 18:28:19 skidder Exp $ +$Id: gen.cpp,v 1.11 2002-09-25 17:12:06 skidder Exp $ */ #include "firebird.h" @@ -114,7 +114,7 @@ UCHAR GEN_expand_buffer( REQ request, UCHAR byte) ULONG length = request->req_blr_string->str_length + 2048; DsqlMemoryPool *pool = (MemoryPool::blk_pool(request->req_blr_string) == DSQL_permanent_pool) ? DSQL_permanent_pool : tdsql->tsql_default; - STR new_buffer = new(*pool, length) str; + STR new_buffer = FB_NEW_RPT(*pool, length) str; new_buffer->str_length = length; p = new_buffer->str_data; @@ -669,7 +669,7 @@ void GEN_port( REQ request, MSG message) /* Allocate buffer for message */ - buffer = new(*tdsql->tsql_default, message->msg_length + DOUBLE_ALIGN - 1) str; + buffer = FB_NEW_RPT(*tdsql->tsql_default, message->msg_length + DOUBLE_ALIGN - 1) str; message->msg_buffer = (UCHAR *) FB_ALIGN((U_IPTR) buffer->str_data, DOUBLE_ALIGN); diff --git a/src/dsql/make.cpp b/src/dsql/make.cpp index 0fb2b3efd3..0cd59b6389 100644 --- a/src/dsql/make.cpp +++ b/src/dsql/make.cpp @@ -82,7 +82,7 @@ NOD MAKE_constant(STR constant, int numeric_flag) tdsql = GET_THREAD_DATA; - node = new(*tdsql->tsql_default, + node = FB_NEW_RPT(*tdsql->tsql_default, (numeric_flag == CONSTANT_TIMESTAMP || numeric_flag == CONSTANT_SINT64) ? 2 : 1) nod; node->nod_type = nod_constant; @@ -223,7 +223,7 @@ NOD MAKE_str_constant(STR constant, SSHORT character_set) tdsql = GET_THREAD_DATA; - node = new(*tdsql->tsql_default, 1) nod; + node = FB_NEW_RPT(*tdsql->tsql_default, 1) nod; node->nod_type = nod_constant; DEV_BLKCHK(constant, dsql_type_str); @@ -1390,7 +1390,7 @@ NOD MAKE_node(NOD_TYPE type, int count) tdsql = GET_THREAD_DATA; - node = new(*tdsql->tsql_default, count) nod; + node = FB_NEW_RPT(*tdsql->tsql_default, count) nod; node->nod_type = type; node->nod_count = count; @@ -1418,7 +1418,7 @@ PAR MAKE_parameter(MSG message, USHORT sqlda_flag, USHORT null_flag) tdsql = GET_THREAD_DATA; - parameter = new(*tdsql->tsql_default) par; + parameter = FB_NEW(*tdsql->tsql_default) par; parameter->par_message = message; parameter->par_next = message->msg_parameters; if (parameter->par_next != 0) @@ -1488,7 +1488,7 @@ SYM MAKE_symbol(DBB database, tdsql = GET_THREAD_DATA; - symbol = new(*tdsql->tsql_default, length) sym; + symbol = FB_NEW_RPT(*tdsql->tsql_default, length) sym; symbol->sym_type = type; symbol->sym_object = (BLK) object; symbol->sym_dbb = database; @@ -1523,7 +1523,7 @@ STR MAKE_tagged_string(CONST UCHAR * str_, int length, CONST TEXT * charset) tdsql = GET_THREAD_DATA; - string = new(*tdsql->tsql_default, length) str; + string = FB_NEW_RPT(*tdsql->tsql_default, length) str; string->str_charset = const_cast < char *>(charset); string->str_length = length; for (p = string->str_data; length; --length) @@ -1576,7 +1576,7 @@ NOD MAKE_variable(FLD field, tdsql = GET_THREAD_DATA; - var_ = new(*tdsql->tsql_default, strlen(name)) var; + var_ = FB_NEW_RPT(*tdsql->tsql_default, strlen(name)) var; node = MAKE_node(nod_variable, e_var_count); node->nod_arg[e_var_variable] = (NOD) var_; var_->var_msg_number = msg_number; diff --git a/src/dsql/metd.epp b/src/dsql/metd.epp index e24580d440..67038b68a8 100644 --- a/src/dsql/metd.epp +++ b/src/dsql/metd.epp @@ -303,7 +303,7 @@ INTLSYM METD_get_collation(REQ request, STR name) THREAD_ENTER; - iname = new(*dbb->dbb_pool, name->str_length) intlsym; + iname = FB_NEW_RPT(*dbb->dbb_pool, name->str_length) intlsym; strcpy(iname->intlsym_name, (TEXT *) name->str_data); iname->intlsym_type = INTLSYM_collation; iname->intlsym_flags = 0; @@ -327,7 +327,7 @@ INTLSYM METD_get_collation(REQ request, STR name) /* Store in the symbol table */ - symbol = iname->intlsym_symbol = new(*dbb->dbb_pool, 0) sym; + symbol = iname->intlsym_symbol = FB_NEW_RPT(*dbb->dbb_pool, 0) sym; symbol->sym_object = (BLK) iname; symbol->sym_string = iname->intlsym_name; symbol->sym_length = name->str_length; @@ -506,7 +506,7 @@ INTLSYM METD_get_charset(REQ request, USHORT length, UCHAR * name) THREAD_ENTER; - iname = new(*dbb->dbb_pool, length) intlsym; + iname = FB_NEW_RPT(*dbb->dbb_pool, length) intlsym; strcpy(iname->intlsym_name, (char*) name); iname->intlsym_type = INTLSYM_charset; iname->intlsym_flags = 0; @@ -532,7 +532,7 @@ INTLSYM METD_get_charset(REQ request, USHORT length, UCHAR * name) /* Store in the symbol table */ - symbol = iname->intlsym_symbol = new(*dbb->dbb_pool, 0) sym; + symbol = iname->intlsym_symbol = FB_NEW_RPT(*dbb->dbb_pool, 0) sym; symbol->sym_object = (BLK) iname; symbol->sym_string = iname->intlsym_name; symbol->sym_length = length; @@ -646,7 +646,7 @@ STR METD_get_default_charset(REQ request) /* Terminate ASCIIZ string on first trailing blank */ metd_exact_name(DBB.RDB$CHARACTER_SET_NAME); length = strlen(DBB.RDB$CHARACTER_SET_NAME); - dbb->dbb_dfl_charset = new(*dbb->dbb_pool, length) str; + dbb->dbb_dfl_charset = FB_NEW_RPT(*dbb->dbb_pool, length) str; dbb->dbb_dfl_charset->str_length = length; dbb->dbb_dfl_charset->str_charset = NULL; str_ = (UCHAR*) DBB.RDB$CHARACTER_SET_NAME; @@ -907,7 +907,7 @@ UDF METD_get_function(REQ request, STR name) THREAD_ENTER; - udf_ = new(*dbb->dbb_pool, name->str_length) udf; + udf_ = FB_NEW_RPT(*dbb->dbb_pool, name->str_length) udf; /* Moved below as still can't say for sure it will be stored. Following the same logic for MET_get_procedure and MET_get_relation udf_->udf_next = dbb->dbb_functions; @@ -994,7 +994,7 @@ UDF METD_get_function(REQ request, STR name) else { DSC* d; /* udf_param_node = MAKE_node (type_nod, 0); */ - udf_param_node = new(*dbb->dbb_pool, 0) nod; + udf_param_node = FB_NEW_RPT(*dbb->dbb_pool, 0) nod; d = &udf_param_node->nod_desc; d->dsc_dtype = (X.RDB$FIELD_TYPE != blr_blob) ? gds_cvt_blr_dtype [X.RDB$FIELD_TYPE] : dtype_blob; @@ -1055,7 +1055,7 @@ UDF METD_get_function(REQ request, STR name) } /* udf->udf_arguments = MAKE_node (nod_list, count); */ - udf_->udf_arguments = new(*dbb->dbb_pool, arg_count) nod; + udf_->udf_arguments = FB_NEW_RPT(*dbb->dbb_pool, arg_count) nod; udf_->udf_arguments->nod_type = nod_list; udf_->udf_arguments->nod_count = arg_count; @@ -1093,7 +1093,7 @@ UDF METD_get_function(REQ request, STR name) /* Store in the symbol table */ /* The UDF_new_udf flag is not used, so nothing extra to check. */ - symbol = udf_->udf_symbol = new(*dbb->dbb_pool, 0) sym; + symbol = udf_->udf_symbol = FB_NEW_RPT(*dbb->dbb_pool, 0) sym; symbol->sym_object = (BLK) udf_; symbol->sym_string = udf_->udf_name; symbol->sym_length = name->str_length; @@ -1228,7 +1228,7 @@ PRC METD_get_procedure(REQ request, STR name) metd_exact_name(X.RDB$OWNER_NAME); - procedure = new(*dbb->dbb_pool, + procedure = FB_NEW_RPT(*dbb->dbb_pool, name->str_length + strlen(X.RDB$OWNER_NAME)) prc; procedure->prc_id = X.RDB$PROCEDURE_ID; @@ -1275,7 +1275,7 @@ PRC METD_get_procedure(REQ request, STR name) /* allocate the field block */ metd_exact_name(PR.RDB$PARAMETER_NAME); - parameter = new(*dbb->dbb_pool, + parameter = FB_NEW_RPT(*dbb->dbb_pool, strlen(PR.RDB$PARAMETER_NAME)) fld; parameter->fld_next = *ptr; *ptr = parameter; @@ -1346,7 +1346,7 @@ PRC METD_get_procedure(REQ request, STR name) procedure->prc_next = dbb->dbb_procedures; dbb->dbb_procedures = procedure; - symbol = procedure->prc_symbol = new(*dbb->dbb_pool, 0) sym; + symbol = procedure->prc_symbol = FB_NEW_RPT(*dbb->dbb_pool, 0) sym; symbol->sym_object = (BLK) procedure; symbol->sym_string = procedure->prc_name; symbol->sym_length = name->str_length; @@ -1424,13 +1424,13 @@ DSQL_REL METD_get_relation(REQ request, STR name) metd_exact_name(X.RDB$OWNER_NAME); if (!X.RDB$RELATION_ID.NULL) { - relation = new(*dbb->dbb_pool, + relation = FB_NEW_RPT(*dbb->dbb_pool, name->str_length + strlen(X.RDB$OWNER_NAME)) dsql_rel; relation->rel_id = X.RDB$RELATION_ID; } else if (!DDL_ids(request)) { relation = - new(*tdsql->tsql_default, + FB_NEW_RPT(*tdsql->tsql_default, name->str_length + strlen(X.RDB$OWNER_NAME)) dsql_rel; relation->rel_flags |= REL_new_relation; } @@ -1487,10 +1487,10 @@ DSQL_REL METD_get_relation(REQ request, STR name) /* Allocate from default or permanent pool as appropriate */ if (relation->rel_flags & REL_new_relation) - *ptr = field = new(*tdsql->tsql_default, + *ptr = field = FB_NEW_RPT(*tdsql->tsql_default, strlen(RFR.RDB$FIELD_NAME)) fld; else - *ptr = field = new(*dbb->dbb_pool, + *ptr = field = FB_NEW_RPT(*dbb->dbb_pool, strlen(RFR.RDB$FIELD_NAME)) fld; ptr = &field->fld_next; @@ -1539,10 +1539,10 @@ DSQL_REL METD_get_relation(REQ request, STR name) /* Allocate from default or permanent pool as appropriate */ if (relation->rel_flags & REL_new_relation) - *ptr = field = new(*tdsql->tsql_default, + *ptr = field = FB_NEW_RPT(*tdsql->tsql_default, strlen(RFR.RDB$FIELD_NAME)) fld; else - *ptr = field = new(*dbb->dbb_pool, + *ptr = field = FB_NEW_RPT(*dbb->dbb_pool, strlen(RFR.RDB$FIELD_NAME)) fld; ptr = &field->fld_next; @@ -1619,7 +1619,7 @@ DSQL_REL METD_get_relation(REQ request, STR name) /* store in the symbol table unless the relation is not yet committed */ - symbol = relation->rel_symbol = new(*dbb->dbb_pool, 0) sym; + symbol = relation->rel_symbol = FB_NEW_RPT(*dbb->dbb_pool, 0) sym; symbol->sym_object = (BLK) relation; symbol->sym_string = relation->rel_name; symbol->sym_length = name->str_length; diff --git a/src/dsql/parse.cpp b/src/dsql/parse.cpp index c9f0c796a9..df919353f2 100644 --- a/src/dsql/parse.cpp +++ b/src/dsql/parse.cpp @@ -8,6 +8,7 @@ static char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; #define yyerrok (DSQL_yyerrflag=0) #define YYRECOVERING (DSQL_yyerrflag!=0) #define YYPREFIX "yy" +#line 2 "parse.y" /* * PROGRAM: Dynamic SQL runtime support * MODULE: parse.y @@ -149,6 +150,7 @@ static TEXT *beginning; static SSHORT log_defined, cache_defined; static void yyerror (TEXT *); +#line 154 "y.tab.c" #define ACTIVE 257 #define ADD 258 #define AFTER 259 @@ -3969,6 +3971,7 @@ static YYSTYPE yylval; static short DSQL_yyss[YYSTACKSIZE]; static YYSTYPE yyvs[YYSTACKSIZE]; #define yystacksize YYSTACKSIZE +#line 3770 "parse.y" /* @@ -4031,13 +4034,13 @@ for (token = KEYWORD_getTokens(); token->tok_string; ++token) SYM symbol; STR str_; - symbol = new(*DSQL_permanent_pool, 0) sym; + symbol = FB_NEW_RPT(*DSQL_permanent_pool, 0) sym; symbol->sym_string = (TEXT *) token->tok_string; symbol->sym_length = strlen (token->tok_string); symbol->sym_type = SYM_keyword; symbol->sym_keyword = token->tok_ident; symbol->sym_version = token->tok_version; - str_ = new(*DSQL_permanent_pool, symbol->sym_length) str; + str_ = FB_NEW_RPT(*DSQL_permanent_pool, symbol->sym_length) str; str_->str_length = symbol->sym_length; strncpy ((char*)str_->str_data, (char*)symbol->sym_string, symbol->sym_length); symbol->sym_object = (void *) str_; @@ -4176,12 +4179,12 @@ tdsql = GET_THREAD_DATA; if (field_name == NULL) { - field = new (*tdsql->tsql_default, sizeof (INTERNAL_FIELD_NAME)) fld; + field = FB_NEW_RPT(*tdsql->tsql_default, sizeof (INTERNAL_FIELD_NAME)) fld; strcpy (field->fld_name, (TEXT*) INTERNAL_FIELD_NAME); return field; } string = (STR) field_name->nod_arg [1]; -field = new(*tdsql->tsql_default, strlen ((SCHAR*) string->str_data)) fld; +field = FB_NEW_RPT(*tdsql->tsql_default, strlen ((SCHAR*) string->str_data)) fld; strcpy (field->fld_name, (TEXT*) string->str_data); return field; @@ -4205,7 +4208,7 @@ TSQL tdsql; tdsql = GET_THREAD_DATA; -temp_file = new(*tdsql->tsql_default) fil; +temp_file = FB_NEW(*tdsql->tsql_default) fil; return temp_file; } @@ -4241,7 +4244,7 @@ for (l = 0, temp = stack; temp; temp = temp->lls_next) l++; old = node; -node = new(*tdsql->tsql_default, l) nod; +node = FB_NEW_RPT(*tdsql->tsql_default, l) nod; node->nod_count = l; node->nod_type = nod_list; node->nod_flags = old->nod_flags; @@ -4276,7 +4279,7 @@ TSQL tdsql; tdsql = GET_THREAD_DATA; -node = new(*tdsql->tsql_default, count) nod; +node = FB_NEW_RPT(*tdsql->tsql_default, count) nod; node->nod_type = type; node->nod_line = (USHORT) lines_bk; node->nod_column = (USHORT) (last_token_bk - line_start_bk + 1); @@ -4313,7 +4316,7 @@ TSQL tdsql; tdsql = GET_THREAD_DATA; -node = new(*tdsql->tsql_default, count) nod; +node = FB_NEW_RPT(*tdsql->tsql_default, count) nod; node->nod_type = type; node->nod_flags = flag; node->nod_line = (USHORT) lines_bk; @@ -5052,6 +5055,7 @@ static void yyabandon ( ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) sql_code, gds_arg_gds, error_symbol, 0); } +#line 5055 "y.tab.c" #define YYABORT goto yyabort #define YYREJECT goto yyabort #define YYACCEPT goto yyaccept @@ -5193,444 +5197,575 @@ yyreduce: switch (yyn) { case 1: +#line 442 "parse.y" { DSQL_parse = yyvsp[0]; } break; case 2: +#line 444 "parse.y" { DSQL_parse = yyvsp[-1]; } break; case 20: +#line 465 "parse.y" { prepare_console_debug ((int) yyvsp[0], &yydebug); yyval = make_node (nod_null, (int) 0, NULL); } break; case 21: +#line 474 "parse.y" { yyval = make_node (nod_grant, (int) e_grant_count, yyvsp[-5], yyvsp[-3], make_list(yyvsp[-1]), yyvsp[0]); } break; case 22: +#line 478 "parse.y" { yyval = make_node (nod_grant, (int) e_grant_count, yyvsp[-6], yyvsp[-3], make_list(yyvsp[-1]), yyvsp[0]); } break; case 23: +#line 482 "parse.y" { yyval = make_node (nod_grant, (int) e_grant_count, yyvsp[-4], yyvsp[-2], make_list(yyvsp[0]), NULL); } break; case 24: +#line 486 "parse.y" { yyval = make_node (nod_grant, (int) e_grant_count, yyvsp[-5], yyvsp[-2], make_list(yyvsp[0]), NULL); } break; case 25: +#line 489 "parse.y" { yyval = make_node (nod_grant, (int) e_grant_count, make_list(yyvsp[-3]), make_list(yyvsp[-1]), NULL, yyvsp[0]); } break; case 27: +#line 495 "parse.y" { yyval = yyvsp[0]; } break; case 28: +#line 499 "parse.y" { yyval = make_node (nod_all, (int) 0, NULL); } break; case 29: +#line 501 "parse.y" { yyval = make_node (nod_all, (int) 0, NULL); } break; case 30: +#line 503 "parse.y" { yyval = make_list (yyvsp[0]); } break; case 32: +#line 508 "parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-2], yyvsp[0]); } break; case 33: +#line 512 "parse.y" { yyval = make_list (make_node (nod_execute, (int) 0, NULL)); } break; case 34: +#line 516 "parse.y" { yyval = make_node (nod_select, (int) 0, NULL); } break; case 35: +#line 518 "parse.y" { yyval = make_node (nod_insert, (int) 0, NULL); } break; case 36: +#line 520 "parse.y" { yyval = make_node (nod_delete, (int) 0, NULL); } break; case 37: +#line 522 "parse.y" { yyval = make_node (nod_update, (int) 1, yyvsp[0]); } break; case 38: +#line 524 "parse.y" { yyval = make_node (nod_references, (int) 1, yyvsp[0]); } break; case 39: +#line 528 "parse.y" { yyval = make_node (nod_grant, (int) 0, NULL); } break; case 40: +#line 530 "parse.y" { yyval = 0; } break; case 41: +#line 534 "parse.y" { yyval = make_node (nod_grant_admin, (int) 0, NULL); } break; case 42: +#line 536 "parse.y" { yyval = 0; } break; case 43: +#line 540 "parse.y" { yyval = make_node (nod_procedure_name, (int) 1, yyvsp[0]); } break; case 44: +#line 548 "parse.y" { yyval = make_node (nod_revoke, (int) e_grant_count, yyvsp[-4], yyvsp[-2], make_list(yyvsp[0]), yyvsp[-5]); } break; case 45: +#line 553 "parse.y" { yyval = make_node (nod_revoke, (int) e_grant_count, yyvsp[-5], yyvsp[-2], make_list(yyvsp[0]), yyvsp[-6]); } break; case 46: +#line 558 "parse.y" { yyval = make_node (nod_revoke, (int) e_grant_count, yyvsp[-4], yyvsp[-2], make_list(yyvsp[0]), NULL); } break; case 47: +#line 563 "parse.y" { yyval = make_node (nod_revoke, (int) e_grant_count, yyvsp[-5], yyvsp[-2], make_list(yyvsp[0]), NULL); } break; case 48: +#line 568 "parse.y" { yyval = make_node (nod_revoke, (int) e_grant_count, yyvsp[-4], yyvsp[-2], make_list(yyvsp[0]), NULL); } break; case 49: +#line 573 "parse.y" { yyval = make_node (nod_revoke, (int) e_grant_count, yyvsp[-5], yyvsp[-2], make_list(yyvsp[0]), NULL); } break; case 50: +#line 577 "parse.y" { yyval = make_node (nod_revoke, (int) e_grant_count, make_list(yyvsp[-2]), make_list(yyvsp[0]), NULL, NULL); } break; case 51: +#line 583 "parse.y" { yyval = make_node (nod_grant, (int) 0, NULL); } break; case 53: +#line 588 "parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-2], yyvsp[0]); } break; case 54: +#line 590 "parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-2], yyvsp[0]); } break; case 55: +#line 592 "parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-2], yyvsp[0]); } break; case 56: +#line 596 "parse.y" { yyval = make_node (nod_proc_obj, (int) 1, yyvsp[0]); } break; case 57: +#line 598 "parse.y" { yyval = make_node (nod_trig_obj, (int) 1, yyvsp[0]); } break; case 58: +#line 600 "parse.y" { yyval = make_node (nod_view_obj, (int) 1, yyvsp[0]); } break; case 59: +#line 602 "parse.y" { yyval = make_node (nod_role_name, (int) 1, yyvsp[0]); } break; case 61: +#line 607 "parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-2], yyvsp[0]); } break; case 62: +#line 614 "parse.y" { yyval = make_node (nod_user_name, (int) 1, yyvsp[0]); } break; case 63: +#line 616 "parse.y" { yyval = make_node (nod_user_name, (int) 2, yyvsp[0], NULL); } break; case 64: +#line 618 "parse.y" { yyval = make_node (nod_user_group, (int) 1, yyvsp[0]); } break; case 66: +#line 623 "parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-2], yyvsp[0]); } break; case 67: +#line 627 "parse.y" { yyval = make_node (nod_role_name, (int) 1, yyvsp[0]); } break; case 69: +#line 632 "parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-2], yyvsp[0]); } break; case 70: +#line 636 "parse.y" { yyval = make_node (nod_user_name, (int) 1, yyvsp[0]); } break; case 71: +#line 638 "parse.y" { yyval = make_node (nod_user_name, (int) 1, yyvsp[0]); } break; case 72: +#line 645 "parse.y" { yyval = yyvsp[0];} break; case 73: +#line 649 "parse.y" { yyval = yyvsp[0]; } break; case 74: +#line 651 "parse.y" { yyval = yyvsp[0]; } break; case 75: +#line 657 "parse.y" { yyval = make_node (nod_def_udf, (int) e_udf_count, yyvsp[-7], yyvsp[-2], yyvsp[0], make_list (yyvsp[-6]), yyvsp[-4]); } break; case 77: +#line 663 "parse.y" { g_field->fld_dtype = dtype_blob; } break; case 78: +#line 665 "parse.y" { g_field->fld_dtype = dtype_cstring; g_field->fld_character_length = (USHORT) yyvsp[-2]; } break; case 79: +#line 671 "parse.y" { yyval = (NOD) NULL; } break; case 81: +#line 674 "parse.y" { yyval = yyvsp[-1]; } break; case 83: +#line 679 "parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-2], yyvsp[0]); } break; case 84: +#line 685 "parse.y" { yyval = make_node (nod_udf_param, (int) e_udf_param_count, yyvsp[-1], NULL); } break; case 85: +#line 688 "parse.y" { yyval = make_node (nod_udf_param, (int) e_udf_param_count, yyvsp[-3], MAKE_constant ((STR) FUN_descriptor, CONSTANT_SLONG)); } break; case 87: +#line 695 "parse.y" { yyval = yyvsp[-1]; } break; case 88: +#line 698 "parse.y" { yyval = make_node (nod_udf_return_value, (int) 2, yyvsp[-1], MAKE_constant ((STR) FUN_reference, CONSTANT_SLONG));} break; case 89: +#line 701 "parse.y" { yyval = make_node (nod_udf_return_value, (int) 2, yyvsp[-2], MAKE_constant ((STR) (-1 * FUN_reference), CONSTANT_SLONG));} break; case 90: +#line 705 "parse.y" { yyval = make_node (nod_udf_return_value, (int) 2, yyvsp[-3], MAKE_constant ((STR) FUN_value, CONSTANT_SLONG));} break; case 91: +#line 709 "parse.y" { yyval = make_node (nod_udf_return_value, (int) 2, yyvsp[-3], MAKE_constant ((STR) FUN_descriptor, CONSTANT_SLONG));} break; case 92: +#line 712 "parse.y" { yyval = make_node (nod_udf_return_value, (int) 2, (NOD) NULL, MAKE_constant ((STR) yyvsp[0], CONSTANT_SLONG));} break; case 93: +#line 718 "parse.y" { yyval = make_node (nod_def_filter, (int) e_filter_count, yyvsp[-8], yyvsp[-6], yyvsp[-4], yyvsp[-2], yyvsp[0]); } break; case 94: +#line 726 "parse.y" { yyval = yyvsp[0]; } break; case 95: +#line 730 "parse.y" { yyval = make_node (nod_def_exception, (int) e_xcp_count, yyvsp[-1], yyvsp[0]); } break; case 96: +#line 733 "parse.y" { yyval = make_node (nod_def_index, (int) e_idx_count, yyvsp[-6], yyvsp[-5], yyvsp[-3], yyvsp[-1], yyvsp[0]); } break; case 97: +#line 736 "parse.y" { yyval = yyvsp[0]; } break; case 98: +#line 738 "parse.y" { yyval = yyvsp[0]; } break; case 99: +#line 740 "parse.y" { yyval = yyvsp[0]; } break; case 100: +#line 742 "parse.y" { yyval = yyvsp[0]; } break; case 101: +#line 744 "parse.y" { yyval = yyvsp[0]; } break; case 102: +#line 746 "parse.y" { yyval = yyvsp[0]; } break; case 103: +#line 748 "parse.y" { yyval = yyvsp[0]; } break; case 104: +#line 750 "parse.y" { yyval = yyvsp[0]; } break; case 105: +#line 752 "parse.y" { yyval = yyvsp[0]; } break; case 106: +#line 757 "parse.y" { yyval = yyvsp[0]; } break; case 107: +#line 761 "parse.y" { yyval = yyvsp[0]; } break; case 108: +#line 763 "parse.y" { yyval = yyvsp[0]; } break; case 109: +#line 765 "parse.y" { yyval = yyvsp[0]; } break; case 110: +#line 774 "parse.y" { yyval = yyvsp[0]; } break; case 111: +#line 778 "parse.y" { yyval = yyvsp[0]; } break; case 112: +#line 780 "parse.y" { yyval = yyvsp[0]; } break; case 113: +#line 782 "parse.y" { yyval = yyvsp[0]; } break; case 114: +#line 789 "parse.y" { yyval = make_node (nod_unique, (int) 0, NULL); } break; case 115: +#line 791 "parse.y" { yyval = NULL; } break; case 116: +#line 795 "parse.y" { yyval = make_list (yyvsp[0]); } break; case 118: +#line 798 "parse.y" { yyval = make_node (nod_def_computed, 2, yyvsp[-2], yyvsp[-1]); } break; case 119: +#line 805 "parse.y" { yyval = make_node (nod_def_shadow, (int) e_shadow_count, yyvsp[-5], yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[-1], make_list (yyvsp[0])); } break; case 120: +#line 810 "parse.y" { yyval = MAKE_constant ((STR) 1, CONSTANT_SLONG); } break; case 121: +#line 812 "parse.y" { yyval = MAKE_constant ((STR) 0, CONSTANT_SLONG); } break; case 122: +#line 814 "parse.y" { yyval = MAKE_constant ((STR) 0, CONSTANT_SLONG); } break; case 123: +#line 818 "parse.y" { yyval = MAKE_constant ((STR) 0, CONSTANT_SLONG); } break; case 124: +#line 820 "parse.y" { yyval = MAKE_constant ((STR) 1, CONSTANT_SLONG); } break; case 125: +#line 824 "parse.y" { yyval = (NOD) 0;} break; case 126: +#line 826 "parse.y" { yyval = yyvsp[-1]; } break; case 127: +#line 830 "parse.y" { yyval = (NOD) NULL; } break; case 130: +#line 836 "parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-1], yyvsp[0]); } break; case 131: +#line 850 "parse.y" { yyval = make_node (nod_def_domain, (int) e_dom_count, yyvsp[-7], yyvsp[-3], yyvsp[-2], make_list (yyvsp[-1]), yyvsp[0]); } break; case 132: +#line 861 "parse.y" { yyval = NULL; } break; case 133: +#line 863 "parse.y" { yyval = NULL; } break; case 134: +#line 867 "parse.y" { yyval = yyvsp[0]; } break; case 135: +#line 869 "parse.y" { yyval = (NOD) NULL; } break; case 136: +#line 873 "parse.y" { yyval = (NOD) NULL; } break; case 139: +#line 879 "parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-1], yyvsp[0]); } break; case 140: +#line 882 "parse.y" { yyval = make_node (nod_rel_constraint, (int) 2, NULL, yyvsp[0]);} break; case 143: +#line 891 "parse.y" { yyval = make_node (nod_null, (int) 0, NULL); } break; case 144: +#line 895 "parse.y" { yyval = make_node (nod_def_constraint, (int) e_cnstr_count, MAKE_string (NULL_STRING, 0), NULL, NULL, NULL, yyvsp[-2], NULL, yyvsp[0], NULL, NULL); } break; case 145: +#line 904 "parse.y" { yyval = make_node (nod_def_generator, (int) e_gen_count, yyvsp[0]); } break; case 146: +#line 912 "parse.y" { yyval = make_node (nod_def_role, (int) 1, yyvsp[0]); } break; case 147: +#line 920 "parse.y" { yyval = make_node (nod_def_database, (int) e_cdb_count, yyvsp[-2], make_list(yyvsp[-1]), make_list (yyvsp[0]));} break; case 150: +#line 929 "parse.y" { log_defined = FALSE; cache_defined = FALSE; yyval = (NOD) yyvsp[0]; } break; case 151: +#line 935 "parse.y" {yyval = (NOD) NULL;} break; case 154: +#line 941 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-1], yyvsp[0]); } break; case 155: +#line 945 "parse.y" { yyval = make_node (nod_page_size, 1, yyvsp[0]);} break; case 156: +#line 947 "parse.y" { yyval = make_node (nod_file_length, 1, yyvsp[-1]);} break; case 157: +#line 949 "parse.y" { yyval = make_node (nod_user_name, 1, yyvsp[0]);} break; case 158: +#line 951 "parse.y" { yyval = make_node (nod_password, 1, yyvsp[0]);} break; case 159: +#line 953 "parse.y" { yyval = make_node (nod_lc_ctype, 1, yyvsp[0]);} break; case 160: +#line 957 "parse.y" {yyval = (NOD) NULL;} break; case 163: +#line 963 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-1], yyvsp[0]); } break; case 167: +#line 971 "parse.y" { yyval = make_node (nod_dfl_charset, 1, yyvsp[0]);} break; case 168: +#line 975 "parse.y" { yyval = make_node (nod_group_commit_wait, 1, yyvsp[0]);} break; case 169: +#line 977 "parse.y" { yyval = make_node (nod_check_point_len, 1, yyvsp[0]);} break; case 170: +#line 979 "parse.y" { yyval = make_node (nod_num_log_buffers, 1, yyvsp[0]);} break; case 171: +#line 981 "parse.y" { yyval = make_node (nod_log_buffer_size, 1, yyvsp[0]);} break; case 172: +#line 985 "parse.y" { if (log_defined) yyabandon (-260, isc_log_redef); /* Log redefined */ log_defined = TRUE; yyval = yyvsp[0]; } break; case 173: +#line 990 "parse.y" { if (log_defined) yyabandon (-260, isc_log_redef); log_defined = TRUE; yyval = yyvsp[0]; } break; case 174: +#line 997 "parse.y" { g_file->fil_flags |= LOG_serial | LOG_overflow; if (g_file->fil_partitions) yyabandon (-261, isc_partition_not_supp); @@ -5638,779 +5773,1008 @@ case 174: yyval = make_node (nod_list, 2, yyvsp[-3], yyvsp[0]); } break; case 175: +#line 1003 "parse.y" { g_file->fil_flags |= LOG_serial; if (g_file->fil_partitions) yyabandon (-261, isc_partition_not_supp); yyval = yyvsp[0]; } break; case 176: +#line 1010 "parse.y" { g_file = make_file(); g_file->fil_flags = LOG_serial | LOG_default; yyval = make_node (nod_log_file_desc, (int) 1, (NOD) g_file);} break; case 177: +#line 1017 "parse.y" { g_file->fil_name = (STR) yyvsp[-1]; yyval = (NOD) make_node (nod_file_desc, (int) 1, (NOD) g_file); } break; case 179: +#line 1051 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 180: +#line 1054 "parse.y" { check_log_file_attrs(); yyval = (NOD) make_node (nod_log_file_desc, (int) 1, (NOD) g_file); } break; case 181: +#line 1060 "parse.y" { g_file = make_file(); g_file->fil_name = (STR) yyvsp[0]; } break; case 184: +#line 1068 "parse.y" { g_file->fil_length = (SLONG) yyvsp[0]; } break; case 185: +#line 1076 "parse.y" { g_file = make_file ();} break; case 190: +#line 1088 "parse.y" { g_file->fil_start = (SLONG) yyvsp[0];} break; case 191: +#line 1090 "parse.y" { g_file->fil_length = (SLONG) yyvsp[-1];} break; case 198: +#line 1107 "parse.y" { yyval = make_node (nod_def_relation, (int) e_drl_count, yyvsp[-4], make_list (yyvsp[-1]), yyvsp[-3]); } break; case 199: +#line 1112 "parse.y" { yyval = make_node (nod_redef_relation, (int) e_drl_count, yyvsp[-4], make_list (yyvsp[-1]), yyvsp[-3]); } break; case 200: +#line 1117 "parse.y" { yyval = yyvsp[0]; } break; case 201: +#line 1119 "parse.y" { yyval = yyvsp[0]; } break; case 202: +#line 1121 "parse.y" { yyval = (NOD) NULL; } break; case 204: +#line 1126 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 207: +#line 1139 "parse.y" { yyval = make_node (nod_def_field, (int) e_dfl_count, yyvsp[-5], yyvsp[-3], yyvsp[-2], make_list (yyvsp[-1]), yyvsp[0], yyvsp[-4], NULL); } break; case 208: +#line 1142 "parse.y" { yyval = make_node (nod_def_field, (int) e_dfl_count, yyvsp[-2], NULL, NULL, NULL, NULL, NULL, yyvsp[0]); } break; case 209: +#line 1146 "parse.y" { yyval = make_node (nod_def_field, (int) e_dfl_count, yyvsp[-1], NULL, NULL, NULL, NULL, NULL, yyvsp[0]); } break; case 210: +#line 1155 "parse.y" { g_field->fld_flags |= FLD_computed; yyval = make_node (nod_def_computed, 2, yyvsp[-2], yyvsp[-1]); } break; case 213: +#line 1165 "parse.y" { yyval = NULL; } break; case 214: +#line 1167 "parse.y" { yyval = make_node (nod_def_domain, (int) e_dom_count, yyvsp[-1], NULL, NULL, NULL, NULL); } break; case 215: +#line 1172 "parse.y" { yyval = yyvsp[0]; } break; case 216: +#line 1174 "parse.y" { yyval = (NOD) NULL; } break; case 217: +#line 1179 "parse.y" { g_field_name = yyvsp[0]; g_field = make_field (yyvsp[0]); yyval = (NOD) g_field; } break; case 218: +#line 1185 "parse.y" { g_field = make_field (yyvsp[0]); yyval = (NOD) g_field; } break; case 219: +#line 1191 "parse.y" { yyval = yyvsp[-1]; } break; case 220: +#line 1194 "parse.y" { g_field = make_field (NULL); yyval = (NOD) g_field; } break; case 221: +#line 1199 "parse.y" { yyval = yyvsp[0]; } break; case 222: +#line 1201 "parse.y" { yyval = (NOD) NULL; } break; case 226: +#line 1212 "parse.y" { yyval = yyvsp[0]; } break; case 227: +#line 1214 "parse.y" { yyval = yyvsp[0]; } break; case 228: +#line 1216 "parse.y" { yyval = yyvsp[0]; } break; case 229: +#line 1220 "parse.y" { yyval = (NOD) NULL; } break; case 232: +#line 1226 "parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-1], yyvsp[0]); } break; case 233: +#line 1230 "parse.y" { yyval = make_node (nod_rel_constraint, (int) 2, yyvsp[-1], yyvsp[0]);} break; case 234: +#line 1234 "parse.y" { yyval = make_node (nod_null, (int) 1, NULL); } break; case 235: +#line 1237 "parse.y" { yyval = make_node (nod_foreign, e_for_count, make_node (nod_list, (int) 1, g_field_name), yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0]); } break; case 237: +#line 1242 "parse.y" { yyval = make_node (nod_unique, 2, NULL, yyvsp[0]); } break; case 238: +#line 1244 "parse.y" { yyval = make_node (nod_primary, e_pri_count, NULL, yyvsp[0]); } break; case 239: +#line 1252 "parse.y" { yyval = make_node (nod_rel_constraint, (int) 2, yyvsp[-1], yyvsp[0]);} break; case 240: +#line 1256 "parse.y" { yyval = yyvsp[0]; } break; case 241: +#line 1257 "parse.y" { yyval = NULL ;} break; case 246: +#line 1267 "parse.y" { yyval = make_node (nod_unique, 2, yyvsp[-1], yyvsp[0]); } break; case 247: +#line 1271 "parse.y" { yyval = make_node (nod_primary, e_pri_count, yyvsp[-1], yyvsp[0]); } break; case 248: +#line 1277 "parse.y" { yyval = make_node (nod_foreign, e_for_count, yyvsp[-5], yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0]); } break; case 249: +#line 1282 "parse.y" { yyval = make_node (nod_def_index, (int) e_idx_count, NULL, yyvsp[-2], yyvsp[0], NULL, NULL); } break; case 250: +#line 1289 "parse.y" { yyval = make_node (nod_def_index, (int) e_idx_count, NULL, NULL, NULL, NULL, NULL); } break; case 251: +#line 1294 "parse.y" { yyval = make_node (nod_def_constraint, (int) e_cnstr_count, MAKE_string (NULL_STRING, 0), NULL, NULL, NULL, yyvsp[-2], NULL, yyvsp[0], NULL, NULL); } break; case 252: +#line 1301 "parse.y" { yyval = make_node (nod_ref_upd_del, e_ref_upd_del_count, yyvsp[0], NULL);} break; case 253: +#line 1303 "parse.y" { yyval = make_node (nod_ref_upd_del, e_ref_upd_del_count, NULL, yyvsp[0]);} break; case 254: +#line 1305 "parse.y" { yyval = make_node (nod_ref_upd_del, e_ref_upd_del_count, yyvsp[0], yyvsp[-1]); } break; case 255: +#line 1307 "parse.y" { yyval = make_node (nod_ref_upd_del, e_ref_upd_del_count, yyvsp[-1], yyvsp[0]);} break; case 256: +#line 1309 "parse.y" { yyval = NULL;} break; case 257: +#line 1313 "parse.y" { yyval = yyvsp[0];} break; case 258: +#line 1316 "parse.y" { yyval = yyvsp[0];} break; case 259: +#line 1320 "parse.y" { yyval = make_flag_node (nod_ref_trig_action, REF_ACTION_CASCADE, e_ref_trig_action_count, NULL);} break; case 260: +#line 1323 "parse.y" { yyval = make_flag_node (nod_ref_trig_action, REF_ACTION_SET_DEFAULT, e_ref_trig_action_count, NULL);} break; case 261: +#line 1326 "parse.y" { yyval = make_flag_node (nod_ref_trig_action, REF_ACTION_SET_NULL, e_ref_trig_action_count, NULL);} break; case 262: +#line 1329 "parse.y" { yyval = make_flag_node (nod_ref_trig_action, REF_ACTION_NONE, e_ref_trig_action_count, NULL);} break; case 263: +#line 1343 "parse.y" { yyval = make_node (nod_def_procedure, (int) e_prc_count, yyvsp[-7], yyvsp[-6], yyvsp[-5], yyvsp[-2], yyvsp[-1], yyvsp[0], NULL); } break; case 264: +#line 1355 "parse.y" { yyval = make_node (nod_redef_procedure, (int) e_prc_count, yyvsp[-7], yyvsp[-6], yyvsp[-5], yyvsp[-2], yyvsp[-1], yyvsp[0], NULL); } break; case 265: +#line 1366 "parse.y" { yyval = make_node (nod_replace_procedure, (int) e_prc_count, yyvsp[-7], yyvsp[-6], yyvsp[-5], yyvsp[-2], yyvsp[-1], yyvsp[0], NULL); } break; case 266: +#line 1377 "parse.y" { yyval = make_node (nod_mod_procedure, (int) e_prc_count, yyvsp[-7], yyvsp[-6], yyvsp[-5], yyvsp[-2], yyvsp[-1], yyvsp[0], NULL); } break; case 267: +#line 1383 "parse.y" { yyval = make_list (yyvsp[-1]); } break; case 268: +#line 1385 "parse.y" { yyval = NULL; } break; case 269: +#line 1389 "parse.y" { yyval = yyvsp[0]; } break; case 270: +#line 1391 "parse.y" { yyval = NULL; } break; case 272: +#line 1396 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 273: +#line 1400 "parse.y" { yyval = make_node (nod_def_field, (int) e_dfl_count, yyvsp[-1], NULL, NULL, NULL, NULL, NULL, NULL); } break; case 274: +#line 1406 "parse.y" { yyval = make_list (yyvsp[0]); } break; case 275: +#line 1408 "parse.y" { yyval = NULL; } break; case 277: +#line 1413 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-1], yyvsp[0]); } break; case 278: +#line 1417 "parse.y" { yyval = make_node (nod_def_field, (int) e_dfl_count, yyvsp[-3], yyvsp[-1], NULL, NULL, NULL, NULL, NULL); } break; case 279: +#line 1422 "parse.y" { yyval = NULL; } break; case 280: +#line 1424 "parse.y" { yyval = NULL; } break; case 281: +#line 1428 "parse.y" { yyval = yyvsp[0]; } break; case 282: +#line 1430 "parse.y" { yyval = yyvsp[0]; } break; case 285: +#line 1439 "parse.y" { yyval = make_node (nod_block, e_blk_count, NULL, NULL);} break; case 286: +#line 1444 "parse.y" { yyval = make_node (nod_block, e_blk_count, make_list (yyvsp[-1]), NULL);} break; case 287: +#line 1450 "parse.y" { yyval = make_node (nod_block, e_blk_count, make_list (yyvsp[-2]), make_list (yyvsp[-1]));} break; case 289: +#line 1456 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-1], yyvsp[0]); } break; case 292: +#line 1462 "parse.y" { yyval = make_node (nod_exception_stmt, 1, yyvsp[-1]); } break; case 298: +#line 1469 "parse.y" { yyval = make_node (nod_post, e_pst_count, yyvsp[-1]); } break; case 302: +#line 1474 "parse.y" { yyval = make_node (nod_return, e_rtn_count, NULL); } break; case 303: +#line 1476 "parse.y" { yyval = make_node (nod_exit, 0, NULL); } break; case 304: +#line 1478 "parse.y" { yyval = make_node (nod_breakleave, e_break_count, NULL); } break; case 305: +#line 1482 "parse.y" { yyval = make_node (nod_exec_procedure, e_exe_count, yyvsp[-3], yyvsp[-2], yyvsp[-1]); } break; case 306: +#line 1487 "parse.y" { yyval = make_node (nod_exec_sql, e_exec_vc_count, yyvsp[-1]); } break; case 307: +#line 1491 "parse.y" { yyval = make_node (nod_for_select, e_flp_count, yyvsp[-5], make_list (yyvsp[-3]), yyvsp[-2], yyvsp[0], NULL); } break; case 308: +#line 1496 "parse.y" { yyval = make_node (nod_if, e_if_count, yyvsp[-5], yyvsp[-2], yyvsp[0]); } break; case 309: +#line 1498 "parse.y" { yyval = make_node (nod_if, e_if_count, yyvsp[-3], yyvsp[0], NULL); } break; case 310: +#line 1502 "parse.y" { yyval = make_node (nod_for_select, e_flp_count, yyvsp[-3], make_list (yyvsp[-1]), NULL, NULL); } break; case 311: +#line 1507 "parse.y" { yyval = make_node (nod_var_name, (int) e_vrn_count, yyvsp[0]); } break; case 312: +#line 1512 "parse.y" { yyval = make_list (yyvsp[0]); } break; case 313: +#line 1514 "parse.y" { yyval = make_list (yyvsp[-1]); } break; case 314: +#line 1516 "parse.y" { yyval = NULL; } break; case 315: +#line 1520 "parse.y" { yyval = make_list (yyvsp[0]); } break; case 316: +#line 1522 "parse.y" { yyval = make_list (yyvsp[-1]); } break; case 317: +#line 1524 "parse.y" { yyval = NULL; } break; case 320: +#line 1530 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 321: +#line 1532 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 322: +#line 1536 "parse.y" { yyval = make_node (nod_while, e_while_count, yyvsp[-3], yyvsp[0], NULL); } break; case 323: +#line 1541 "parse.y" { yyval = make_node (nod_cursor, e_cur_count, yyvsp[0], NULL, NULL); } break; case 324: +#line 1543 "parse.y" { yyval = NULL; } break; case 326: +#line 1547 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-1], yyvsp[0]); } break; case 327: +#line 1551 "parse.y" { yyval = make_node (nod_on_error, e_err_count, make_list (yyvsp[-2]), yyvsp[0]); } break; case 329: +#line 1557 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 330: +#line 1561 "parse.y" { yyval = make_node (nod_sqlcode, 1, yyvsp[0]); } break; case 331: +#line 1563 "parse.y" { yyval = make_node (nod_gdscode, 1, yyvsp[0]); } break; case 332: +#line 1565 "parse.y" { yyval = make_node (nod_exception, 1, yyvsp[0]); } break; case 333: +#line 1567 "parse.y" { yyval = make_node (nod_default, 1, NULL); } break; case 334: +#line 1574 "parse.y" { yyval = make_node (nod_exec_procedure, e_exe_count, yyvsp[-1], yyvsp[0], make_node (nod_all, (int) 0, NULL)); } break; case 335: +#line 1579 "parse.y" { yyval = make_list (yyvsp[0]); } break; case 336: +#line 1581 "parse.y" { yyval = make_list (yyvsp[-1]); } break; case 337: +#line 1583 "parse.y" { yyval = NULL; } break; case 341: +#line 1590 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 342: +#line 1592 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 343: +#line 1594 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 344: +#line 1602 "parse.y" { yyval = make_node (nod_def_view, (int) e_view_count, yyvsp[-6], yyvsp[-5], yyvsp[-2], yyvsp[-1], yyvsp[0]); } break; case 345: +#line 1609 "parse.y" { yyval = make_node (nod_redef_view, (int) e_view_count, yyvsp[-6], yyvsp[-5], yyvsp[-2], yyvsp[-1], yyvsp[0]); } break; case 346: +#line 1616 "parse.y" { yyval = make_node (nod_replace_view, (int) e_view_count, yyvsp[-6], yyvsp[-5], yyvsp[-2], yyvsp[-1], yyvsp[0]); } break; case 347: +#line 1622 "parse.y" { yyval = make_node (nod_mod_view, (int) e_view_count, yyvsp[-6], yyvsp[-5], yyvsp[-2], yyvsp[-1], yyvsp[0]); } break; case 348: +#line 1627 "parse.y" { yyval = make_node (nod_select, (int) 2, yyvsp[0], NULL); } break; case 349: +#line 1631 "parse.y" { yyval = make_node (nod_list, (int) 1, yyvsp[0]); } break; case 350: +#line 1633 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 351: +#line 1635 "parse.y" { yyval = make_flag_node (nod_list, NOD_UNION_ALL, 2, yyvsp[-3], yyvsp[0]); } break; case 352: +#line 1646 "parse.y" { yyval = make_node (nod_select_expr, e_sel_count, yyvsp[-7], yyvsp[-6], yyvsp[-5], yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0], NULL); } break; case 353: +#line 1651 "parse.y" { yyval = make_list (yyvsp[0]); } break; case 355: +#line 1656 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 358: +#line 1664 "parse.y" { yyval = make_node (nod_join, (int) e_join_count, yyvsp[-5], yyvsp[-4], yyvsp[-2], yyvsp[0]); } break; case 359: +#line 1667 "parse.y" { yyval = yyvsp[-1]; } break; case 360: +#line 1673 "parse.y" { beginning = lex_position(); } break; case 361: +#line 1677 "parse.y" { yyval = (NOD) MAKE_string ((UCHAR *) beginning, (lex_position() == end) ? lex_position()-beginning : last_token-beginning);} break; case 362: +#line 1683 "parse.y" { beginning = last_token; } break; case 363: +#line 1687 "parse.y" { yyval = (NOD) MAKE_string ((UCHAR *) beginning, lex_position()-beginning); } break; case 364: +#line 1693 "parse.y" { yyval = make_node (nod_def_constraint, (int) e_cnstr_count, MAKE_string (NULL_STRING, 0), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } break; case 365: +#line 1697 "parse.y" { yyval = 0; } break; case 366: +#line 1711 "parse.y" { yyval = make_node (nod_def_trigger, (int) e_trg_count, yyvsp[-8], yyvsp[-6], yyvsp[-5], yyvsp[-4], yyvsp[-3], yyvsp[-1], yyvsp[0], NULL); } break; case 367: +#line 1722 "parse.y" { yyval = make_node (nod_replace_trigger, (int) e_trg_count, yyvsp[-8], yyvsp[-6], yyvsp[-5], yyvsp[-4], yyvsp[-3], yyvsp[-1], yyvsp[0], NULL); } break; case 368: +#line 1727 "parse.y" { yyval = MAKE_constant ((STR) 0, CONSTANT_SLONG); } break; case 369: +#line 1729 "parse.y" { yyval = MAKE_constant ((STR) 1, CONSTANT_SLONG); } break; case 370: +#line 1731 "parse.y" { yyval = NULL; } break; case 371: +#line 1735 "parse.y" { yyval = MAKE_trigger_type (yyvsp[-1], yyvsp[0]); } break; case 372: +#line 1739 "parse.y" { yyval = MAKE_constant ((STR) 0, CONSTANT_SLONG); } break; case 373: +#line 1741 "parse.y" { yyval = MAKE_constant ((STR) 1, CONSTANT_SLONG); } break; case 374: +#line 1745 "parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (1, 0, 0), CONSTANT_SLONG); } break; case 375: +#line 1747 "parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (2, 0, 0), CONSTANT_SLONG); } break; case 376: +#line 1749 "parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (3, 0, 0), CONSTANT_SLONG); } break; case 377: +#line 1751 "parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (1, 2, 0), CONSTANT_SLONG); } break; case 378: +#line 1753 "parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (1, 3, 0), CONSTANT_SLONG); } break; case 379: +#line 1755 "parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (2, 1, 0), CONSTANT_SLONG); } break; case 380: +#line 1757 "parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (2, 3, 0), CONSTANT_SLONG); } break; case 381: +#line 1759 "parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (3, 1, 0), CONSTANT_SLONG); } break; case 382: +#line 1761 "parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (3, 2, 0), CONSTANT_SLONG); } break; case 383: +#line 1763 "parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (1, 2, 3), CONSTANT_SLONG); } break; case 384: +#line 1765 "parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (1, 3, 2), CONSTANT_SLONG); } break; case 385: +#line 1767 "parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (2, 1, 3), CONSTANT_SLONG); } break; case 386: +#line 1769 "parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (2, 3, 1), CONSTANT_SLONG); } break; case 387: +#line 1771 "parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (3, 1, 2), CONSTANT_SLONG); } break; case 388: +#line 1773 "parse.y" { yyval = MAKE_constant ((STR) TRIGGER_TYPE_SUFFIX (3, 2, 1), CONSTANT_SLONG); } break; case 389: +#line 1777 "parse.y" { yyval = MAKE_constant ((STR) yyvsp[0], CONSTANT_SLONG); } break; case 390: +#line 1779 "parse.y" { yyval = NULL; } break; case 391: +#line 1783 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-1], yyvsp[0]); } break; case 392: +#line 1789 "parse.y" { yyval = yyvsp[0]; } break; case 393: +#line 1793 "parse.y" { yyval = make_node (nod_mod_exception, (int) e_xcp_count, yyvsp[-1], yyvsp[0]); } break; case 394: +#line 1796 "parse.y" { yyval = make_node (nod_mod_relation, (int) e_alt_count, yyvsp[-1], make_list (yyvsp[0])); } break; case 395: +#line 1799 "parse.y" { yyval = yyvsp[0]; } break; case 396: +#line 1801 "parse.y" { yyval = yyvsp[0]; } break; case 397: +#line 1803 "parse.y" { yyval = yyvsp[0]; } break; case 398: +#line 1805 "parse.y" { yyval = make_node (nod_mod_database, (int) e_adb_count, make_list (yyvsp[0])); } break; case 399: +#line 1808 "parse.y" { yyval = make_node (nod_mod_domain, (int) e_alt_count, yyvsp[-1], make_list (yyvsp[0])); } break; case 400: +#line 1811 "parse.y" { yyval = make_node (nod_mod_index, (int) e_mod_idx_count, yyvsp[0]); } break; case 401: +#line 1816 "parse.y" { yyval = yyvsp[0]; } break; case 402: +#line 1819 "parse.y" { yyval = make_node (nod_def_constraint, (int) e_cnstr_count, MAKE_string (NULL_STRING, 0), NULL, NULL, NULL, yyvsp[-2], NULL, yyvsp[0], NULL, NULL); } break; case 404: +#line 1826 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-1], yyvsp[0]); } break; case 405: +#line 1830 "parse.y" { yyval = make_node (nod_def_default, (int) e_dft_count, yyvsp[-1], yyvsp[0]); } break; case 406: +#line 1839 "parse.y" { yyval = yyvsp[0]; } break; case 407: +#line 1843 "parse.y" { yyval = yyvsp[0]; } break; case 408: +#line 1845 "parse.y" {yyval = make_node (nod_del_default, (int) 0, NULL); } break; case 409: +#line 1847 "parse.y" { yyval = make_node (nod_delete_rel_constraint, (int) 1, NULL); } break; case 410: +#line 1849 "parse.y" { yyval = yyvsp[0]; } break; case 411: +#line 1851 "parse.y" { yyval = make_node (nod_mod_domain_type, 2, yyvsp[-1]); } break; case 413: +#line 1856 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 414: +#line 1860 "parse.y" { yyval = make_node (nod_del_field, 2, yyvsp[-1], yyvsp[0]); } break; case 415: +#line 1862 "parse.y" { yyval = make_node (nod_delete_rel_constraint, (int) 1, yyvsp[0]);} break; case 416: +#line 1864 "parse.y" { yyval = yyvsp[0]; } break; case 417: +#line 1866 "parse.y" { yyval = yyvsp[0]; } break; case 418: +#line 1872 "parse.y" { yyval = make_node (nod_mod_field_pos, 2, yyvsp[-2], MAKE_constant ((STR) yyvsp[0], CONSTANT_SLONG)); } break; case 419: +#line 1875 "parse.y" { yyval = make_node (nod_mod_field_name, 2, yyvsp[-2], yyvsp[0]); } break; case 420: +#line 1877 "parse.y" { yyval = make_node (nod_mod_field_type, 3, yyvsp[-3], yyvsp[0], yyvsp[-1]); } break; case 421: +#line 1881 "parse.y" { yyval = make_node (nod_field_name, (int) e_fln_count, NULL, yyvsp[0]); } break; case 446: +#line 1912 "parse.y" { yyval = NULL; } break; case 447: +#line 1914 "parse.y" { yyval = NULL; } break; case 448: +#line 1918 "parse.y" { yyval = NULL; } break; case 449: +#line 1920 "parse.y" { yyval = make_node (nod_def_domain, (int) e_dom_count, yyvsp[-1], NULL, NULL, NULL, NULL); } break; case 450: +#line 1924 "parse.y" { g_field_name = yyvsp[0]; g_field = make_field (yyvsp[0]); yyval = (NOD) g_field; } break; case 451: +#line 1929 "parse.y" { yyval = make_node (nod_restrict, 0, NULL); } break; case 452: +#line 1931 "parse.y" { yyval = make_node (nod_cascade, 0, NULL); } break; case 453: +#line 1933 "parse.y" { yyval = make_node (nod_restrict, 0, NULL); } break; case 454: +#line 1937 "parse.y" { yyval = make_node (nod_idx_active, 1, yyvsp[-1]); } break; case 455: +#line 1939 "parse.y" { yyval = make_node (nod_idx_inactive, 1, yyvsp[-1]); } break; case 456: +#line 1946 "parse.y" { log_defined = FALSE; cache_defined = FALSE; yyval = (NOD) NULL; } break; case 458: +#line 1953 "parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-1], yyvsp[0]); } break; case 459: +#line 1957 "parse.y" { yyval = yyvsp[0]; } break; case 460: +#line 1965 "parse.y" { yyval = make_node (nod_drop_log, (int) 0, NULL); } break; case 461: +#line 1967 "parse.y" { yyval = yyvsp[0]; } break; case 462: +#line 1969 "parse.y" { yyval = yyvsp[0]; } break; case 464: +#line 1974 "parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-2], yyvsp[0]); } break; case 465: +#line 1986 "parse.y" { yyval = make_node (nod_mod_trigger, (int) e_trg_count, yyvsp[-6], NULL, yyvsp[-5], yyvsp[-4], yyvsp[-3], yyvsp[-1], yyvsp[0], NULL); } break; case 467: +#line 1992 "parse.y" { yyval = NULL; } break; case 469: +#line 1997 "parse.y" { yyval = NULL; } break; case 470: +#line 2003 "parse.y" { yyval = yyvsp[0]; } break; case 471: +#line 2007 "parse.y" { yyval = make_node (nod_del_exception, 1, yyvsp[0]); } break; case 472: +#line 2009 "parse.y" { yyval = make_node (nod_del_index, (int) 1, yyvsp[0]); } break; case 473: +#line 2011 "parse.y" { yyval = make_node (nod_del_procedure, (int) 1, yyvsp[0]); } break; case 474: +#line 2013 "parse.y" { yyval = make_node (nod_del_relation, (int) 1, yyvsp[0]); } break; case 475: +#line 2015 "parse.y" { yyval = make_node (nod_del_trigger, (int) 1, yyvsp[0]); } break; case 476: +#line 2017 "parse.y" { yyval = make_node (nod_del_view, (int) 1, yyvsp[0]); } break; case 477: +#line 2019 "parse.y" { yyval = make_node (nod_del_filter, (int) 1, yyvsp[0]); } break; case 478: +#line 2021 "parse.y" { yyval = make_node (nod_del_domain, (int) 1, yyvsp[0]); } break; case 479: +#line 2023 "parse.y" { yyval = make_node (nod_del_udf, (int) 1, yyvsp[0]); } break; case 480: +#line 2025 "parse.y" { yyval = make_node (nod_del_shadow, (int) 1, yyvsp[0]); } break; case 481: +#line 2027 "parse.y" { yyval = make_node (nod_del_role, (int) 1, yyvsp[0]); } break; case 482: +#line 2029 "parse.y" { yyval = make_node (nod_del_generator, (int) 1, yyvsp[0]); } break; case 487: +#line 2045 "parse.y" { g_field->fld_ranges = make_list (yyvsp[-1]); g_field->fld_dimensions = g_field->fld_ranges->nod_count / 2; g_field->fld_element_dtype = g_field->fld_dtype; yyval = yyvsp[-3]; } break; case 488: +#line 2050 "parse.y" { g_field->fld_ranges = make_list (yyvsp[-2]); g_field->fld_dimensions = g_field->fld_ranges->nod_count / 2; g_field->fld_element_dtype = g_field->fld_dtype; yyval = yyvsp[-4]; } break; case 490: +#line 2058 "parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-2], yyvsp[0]); } break; case 491: +#line 2062 "parse.y" { if ((SLONG) yyvsp[0] < 1) yyval = make_node (nod_list, (int) 2, MAKE_constant ((STR) yyvsp[0], CONSTANT_SLONG), @@ -6421,11 +6785,13 @@ case 491: MAKE_constant ((STR) yyvsp[0], CONSTANT_SLONG) ); } break; case 492: +#line 2071 "parse.y" { yyval = make_node (nod_list, (int) 2, MAKE_constant ((STR) yyvsp[-2], CONSTANT_SLONG), MAKE_constant ((STR) yyvsp[0], CONSTANT_SLONG)); } break; case 498: +#line 2084 "parse.y" { if (client_dialect < SQL_DIALECT_V6_TRANSITION) ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) -104, @@ -6444,18 +6810,21 @@ case 498: } break; case 499: +#line 2101 "parse.y" { g_field->fld_dtype = dtype_long; g_field->fld_length = sizeof (SLONG); } break; case 500: +#line 2106 "parse.y" { g_field->fld_dtype = dtype_short; g_field->fld_length = sizeof (SSHORT); } break; case 501: +#line 2111 "parse.y" { *stmt_ambiguous = TRUE; if (client_dialect <= SQL_DIALECT_V5) @@ -6476,6 +6845,7 @@ case 501: } break; case 502: +#line 2130 "parse.y" { if (client_dialect < SQL_DIALECT_V6_TRANSITION) ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) -104, @@ -6494,17 +6864,20 @@ case 502: } break; case 503: +#line 2147 "parse.y" { g_field->fld_dtype = dtype_timestamp; g_field->fld_length = sizeof (GDS_TIMESTAMP); } break; case 506: +#line 2162 "parse.y" { g_field->fld_dtype = dtype_blob; } break; case 507: +#line 2166 "parse.y" { g_field->fld_dtype = dtype_blob; g_field->fld_seg_length = (USHORT) yyvsp[-1]; @@ -6512,6 +6885,7 @@ case 507: } break; case 508: +#line 2172 "parse.y" { g_field->fld_dtype = dtype_blob; g_field->fld_seg_length = (USHORT) yyvsp[-3]; @@ -6519,6 +6893,7 @@ case 508: } break; case 509: +#line 2178 "parse.y" { g_field->fld_dtype = dtype_blob; g_field->fld_seg_length = 80; @@ -6526,36 +6901,43 @@ case 509: } break; case 510: +#line 2186 "parse.y" { g_field->fld_seg_length = (USHORT) yyvsp[0]; } break; case 511: +#line 2190 "parse.y" { g_field->fld_seg_length = (USHORT) 80; } break; case 512: +#line 2196 "parse.y" { g_field->fld_sub_type = (USHORT) yyvsp[0]; } break; case 513: +#line 2200 "parse.y" { g_field->fld_sub_type_name = yyvsp[0]; } break; case 514: +#line 2204 "parse.y" { g_field->fld_sub_type = (USHORT) 0; } break; case 515: +#line 2210 "parse.y" { g_field->fld_character_set = yyvsp[0]; } break; case 517: +#line 2221 "parse.y" { g_field->fld_dtype = dtype_text; g_field->fld_character_length = (USHORT) yyvsp[-1]; @@ -6563,6 +6945,7 @@ case 517: } break; case 518: +#line 2227 "parse.y" { g_field->fld_dtype = dtype_text; g_field->fld_character_length = 1; @@ -6570,6 +6953,7 @@ case 518: } break; case 519: +#line 2233 "parse.y" { g_field->fld_dtype = dtype_varying; g_field->fld_character_length = (USHORT) yyvsp[-1]; @@ -6577,29 +6961,34 @@ case 519: } break; case 520: +#line 2241 "parse.y" { g_field->fld_dtype = dtype_text; g_field->fld_character_length = (USHORT) yyvsp[-1]; } break; case 521: +#line 2246 "parse.y" { g_field->fld_dtype = dtype_text; g_field->fld_character_length = 1; } break; case 522: +#line 2251 "parse.y" { g_field->fld_dtype = dtype_varying; g_field->fld_character_length = (USHORT) yyvsp[-1]; } break; case 531: +#line 2276 "parse.y" { g_field->fld_sub_type = dsc_num_type_numeric; } break; case 532: +#line 2280 "parse.y" { g_field->fld_sub_type = dsc_num_type_decimal; if (g_field->fld_dtype == dtype_short) @@ -6610,9 +6999,11 @@ case 532: } break; case 533: +#line 2291 "parse.y" { yyval = make_node (nod_position, 1, yyvsp[0]); } break; case 534: +#line 2298 "parse.y" { g_field->fld_dtype = dtype_long; g_field->fld_length = sizeof (SLONG); @@ -6620,6 +7011,7 @@ case 534: } break; case 535: +#line 2304 "parse.y" { if ( ((SLONG) yyvsp[-1] < 1) || ((SLONG) yyvsp[-1] > 18) ) yyabandon (-842, isc_precision_err); @@ -6675,6 +7067,7 @@ case 535: } break; case 536: +#line 2358 "parse.y" { if ( ((SLONG) yyvsp[-3] < 1) || ((SLONG) yyvsp[-3] > 18) ) yyabandon (-842, isc_precision_err); @@ -6736,6 +7129,7 @@ case 536: } break; case 539: +#line 2428 "parse.y" { if ((SLONG) yyvsp[0] > 7) { @@ -6750,42 +7144,50 @@ case 539: } break; case 540: +#line 2441 "parse.y" { g_field->fld_dtype = dtype_double; g_field->fld_length = sizeof (double); } break; case 541: +#line 2446 "parse.y" { g_field->fld_dtype = dtype_real; g_field->fld_length = sizeof (float); } break; case 542: +#line 2451 "parse.y" { g_field->fld_dtype = dtype_double; g_field->fld_length = sizeof (double); } break; case 543: +#line 2458 "parse.y" { yyval = yyvsp[-1]; } break; case 544: +#line 2460 "parse.y" { yyval = 0; } break; case 548: +#line 2473 "parse.y" { yyval = make_node (nod_set_generator2,e_gen_id_count,yyvsp[-2], MAKE_constant ((STR) yyvsp[0], CONSTANT_SLONG)); } break; case 549: +#line 2478 "parse.y" { yyval = make_node (nod_set_generator2,e_gen_id_count,yyvsp[-2], MAKE_constant((STR)yyvsp[0], CONSTANT_SINT64)); } break; case 550: +#line 2483 "parse.y" { yyval = make_node (nod_set_generator2, e_gen_id_count, yyvsp[-3], make_node(nod_negate, 1, @@ -6793,609 +7195,805 @@ case 550: } break; case 551: +#line 2494 "parse.y" { yyval = make_node (nod_commit, 1, yyvsp[0]); } break; case 552: +#line 2498 "parse.y" { yyval = make_node (nod_rollback, 0, NULL); } break; case 555: +#line 2506 "parse.y" { yyval = make_node (nod_commit_retain, 0, NULL); } break; case 556: +#line 2508 "parse.y" { yyval = (NOD) NULL; } break; case 558: +#line 2513 "parse.y" { yyval = (NOD) NULL; } break; case 559: +#line 2517 "parse.y" {yyval = make_node (nod_trans, 1, make_list (yyvsp[0])); } break; case 561: +#line 2522 "parse.y" { yyval = (NOD) NULL; } break; case 563: +#line 2527 "parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-1], yyvsp[0]); } break; case 568: +#line 2537 "parse.y" { yyval = make_flag_node (nod_access, NOD_READ_ONLY, (int) 0, NULL); } break; case 569: +#line 2539 "parse.y" { yyval = make_flag_node (nod_access, NOD_READ_WRITE, (int) 0, NULL); } break; case 570: +#line 2543 "parse.y" { yyval = make_flag_node (nod_wait, NOD_WAIT, (int) 0, NULL); } break; case 571: +#line 2545 "parse.y" { yyval = make_flag_node (nod_wait, NOD_NO_WAIT, (int) 0, NULL); } break; case 572: +#line 2549 "parse.y" { yyval = yyvsp[0];} break; case 574: +#line 2554 "parse.y" { yyval = yyvsp[0];} break; case 575: +#line 2556 "parse.y" { yyval = make_flag_node (nod_isolation, NOD_READ_COMMITTED, 1, yyvsp[0]); } break; case 576: +#line 2558 "parse.y" { yyval = make_flag_node (nod_isolation, NOD_READ_COMMITTED, 1, yyvsp[0]); } break; case 577: +#line 2562 "parse.y" { yyval = make_flag_node (nod_isolation, NOD_CONCURRENCY, 0, NULL); } break; case 578: +#line 2564 "parse.y" { yyval = make_flag_node (nod_isolation, NOD_CONSISTENCY, 0, NULL); } break; case 579: +#line 2566 "parse.y" { yyval = make_flag_node (nod_isolation, NOD_CONSISTENCY, 0, NULL); } break; case 580: +#line 2570 "parse.y" { yyval = make_flag_node (nod_version, NOD_VERSION, 0, NULL); } break; case 581: +#line 2572 "parse.y" { yyval = make_flag_node (nod_version, NOD_NO_VERSION, 0, NULL); } break; case 582: +#line 2574 "parse.y" { yyval = 0; } break; case 583: +#line 2578 "parse.y" { yyval = make_node (nod_reserve, 1, make_list (yyvsp[0])); } break; case 584: +#line 2582 "parse.y" { yyval = (NOD) NOD_SHARED; } break; case 585: +#line 2584 "parse.y" { yyval = (NOD) NOD_PROTECTED ; } break; case 586: +#line 2586 "parse.y" { yyval = (NOD) 0; } break; case 587: +#line 2590 "parse.y" { yyval = (NOD) NOD_READ; } break; case 588: +#line 2592 "parse.y" { yyval = (NOD) NOD_WRITE; } break; case 590: +#line 2597 "parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-2], yyvsp[0]); } break; case 591: +#line 2601 "parse.y" { yyval = make_node (nod_table_lock, (int) 2, make_list (yyvsp[-1]), yyvsp[0]); } break; case 592: +#line 2605 "parse.y" { yyval = make_flag_node (nod_lock_mode, (SSHORT) ((SSHORT) yyvsp[-1] | (SSHORT) yyvsp[0]), (SSHORT) 0, NULL); } break; case 593: +#line 2607 "parse.y" { yyval = 0; } break; case 595: +#line 2612 "parse.y" { yyval = make_node (nod_list, (int) 2, yyvsp[-2], yyvsp[0]); } break; case 596: +#line 2617 "parse.y" {yyval = make_node (nod_set_statistics, (int)e_stat_count, yyvsp[0]); } break; case 597: +#line 2624 "parse.y" { yyval = make_node (nod_select, 3, yyvsp[-2], yyvsp[-1], yyvsp[0]); } break; case 598: +#line 2628 "parse.y" { yyval = make_node (nod_list, 1, yyvsp[0]); } break; case 599: +#line 2630 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 600: +#line 2632 "parse.y" { yyval = make_flag_node (nod_list, NOD_UNION_ALL, 2, yyvsp[-3], yyvsp[0]); } break; case 601: +#line 2636 "parse.y" { yyval = make_list (yyvsp[0]); } break; case 602: +#line 2638 "parse.y" { yyval = 0; } break; case 604: +#line 2643 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 605: +#line 2647 "parse.y" { yyval = make_node (nod_order, e_order_count, yyvsp[-3], yyvsp[-1], yyvsp[-2], yyvsp[0]); } break; case 606: +#line 2649 "parse.y" { yyval = make_node (nod_order, e_order_count, yyvsp[-3], yyvsp[-1], yyvsp[-2], yyvsp[0]); } break; case 607: +#line 2653 "parse.y" { yyval = 0; } break; case 608: +#line 2655 "parse.y" { yyval = make_node (nod_flag, 0, NULL); } break; case 609: +#line 2657 "parse.y" { yyval = 0; } break; case 610: +#line 2661 "parse.y" { yyval = make_node (nod_flag, 0, NULL); } break; case 611: +#line 2663 "parse.y" { yyval = 0; } break; case 612: +#line 2665 "parse.y" { yyval = 0; } break; case 613: +#line 2669 "parse.y" { yyval = yyvsp[0]; } break; case 614: +#line 2671 "parse.y" { yyval = 0; } break; case 615: +#line 2675 "parse.y" { yyval = yyvsp[0]; } break; case 616: +#line 2677 "parse.y" { yyval = make_node (nod_flag, 0, NULL); } break; case 617: +#line 2691 "parse.y" { yyval = make_node (nod_select_expr, e_sel_count, yyvsp[-7], yyvsp[-6], yyvsp[-5], yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0], NULL); } break; case 618: +#line 2697 "parse.y" { yyval = make_node (nod_flag, 0, NULL); } break; case 619: +#line 2699 "parse.y" { yyval = 0; } break; case 620: +#line 2703 "parse.y" { yyval = make_list (yyvsp[0]); } break; case 621: +#line 2705 "parse.y" { yyval = 0; } break; case 623: +#line 2710 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 625: +#line 2715 "parse.y" { yyval = make_node (nod_alias, 2, yyvsp[-1], yyvsp[0]); } break; case 626: +#line 2717 "parse.y" { yyval = make_node (nod_alias, 2, yyvsp[-2], yyvsp[0]); } break; case 627: +#line 2724 "parse.y" { yyval = make_list (yyvsp[0]); } break; case 629: +#line 2732 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 632: +#line 2740 "parse.y" { yyval = make_node (nod_join, (int) e_join_count, yyvsp[-5], yyvsp[-4], yyvsp[-2], yyvsp[0]); } break; case 633: +#line 2742 "parse.y" { yyval = yyvsp[-1]; } break; case 634: +#line 2746 "parse.y" { yyval = make_node (nod_rel_proc_name, (int) e_rpn_count, yyvsp[-2], yyvsp[0], yyvsp[-1]); } break; case 635: +#line 2749 "parse.y" { yyval = make_node (nod_rel_proc_name, (int) e_rpn_count, yyvsp[-1], NULL, yyvsp[0]); } break; case 636: +#line 2754 "parse.y" { yyval = make_list (yyvsp[-1]); } break; case 637: +#line 2756 "parse.y" { yyval = NULL; } break; case 639: +#line 2761 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 643: +#line 2770 "parse.y" { yyval = make_node (nod_relation_name, (int) e_rln_count, yyvsp[-1], yyvsp[0]); } break; case 644: +#line 2775 "parse.y" { yyval = make_node (nod_relation_name, (int) e_rln_count, yyvsp[0], NULL); } break; case 645: +#line 2780 "parse.y" { yyval = make_node (nod_join_inner, (int) 0, NULL); } break; case 646: +#line 2782 "parse.y" { yyval = make_node (nod_join_left, (int) 0, NULL); } break; case 647: +#line 2784 "parse.y" { yyval = make_node (nod_join_left, (int) 0, NULL); } break; case 648: +#line 2786 "parse.y" { yyval = make_node (nod_join_right, (int) 0, NULL); } break; case 649: +#line 2788 "parse.y" { yyval = make_node (nod_join_right, (int) 0, NULL); } break; case 650: +#line 2790 "parse.y" { yyval = make_node (nod_join_full, (int) 0, NULL); } break; case 651: +#line 2792 "parse.y" { yyval = make_node (nod_join_full, (int) 0, NULL); } break; case 652: +#line 2794 "parse.y" { yyval = make_node (nod_join_inner, (int) 0, NULL); } break; case 653: +#line 2800 "parse.y" { yyval = MAKE_constant ((STR) yyvsp[0], CONSTANT_SLONG); } break; case 654: +#line 2802 "parse.y" { yyval = yyvsp[-1]; } break; case 655: +#line 2804 "parse.y" { yyval = yyvsp[0]; } break; case 656: +#line 2808 "parse.y" { yyval = MAKE_constant ((STR) yyvsp[0], CONSTANT_SLONG); } break; case 657: +#line 2810 "parse.y" { yyval = yyvsp[-1]; } break; case 658: +#line 2812 "parse.y" { yyval = yyvsp[0]; } break; case 659: +#line 2816 "parse.y" { yyval = make_node (nod_limit, e_limit_count, yyvsp[0], yyvsp[-1]); } break; case 660: +#line 2818 "parse.y" { yyval = make_node (nod_limit, e_limit_count, NULL, yyvsp[0]); } break; case 661: +#line 2820 "parse.y" { yyval = make_node (nod_limit, e_limit_count, yyvsp[0], NULL); } break; case 662: +#line 2822 "parse.y" { yyval = 0; } break; case 663: +#line 2826 "parse.y" { yyval = make_list (yyvsp[0]); } break; case 664: +#line 2828 "parse.y" { yyval = 0; } break; case 666: +#line 2833 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 671: +#line 2841 "parse.y" { yyval = make_node (nod_collate, e_coll_count, (NOD) yyvsp[0], yyvsp[-2]); } break; case 675: +#line 2850 "parse.y" { yyval = yyvsp[0]; } break; case 676: +#line 2852 "parse.y" { yyval = 0; } break; case 677: +#line 2856 "parse.y" { yyval = yyvsp[0]; } break; case 678: +#line 2858 "parse.y" { yyval = 0; } break; case 679: +#line 2862 "parse.y" { yyval = make_node (nod_top, 1, yyvsp[-2]);} break; case 680: +#line 2864 "parse.y" { yyval = make_node (nod_top, 2, yyvsp[-4], yyvsp[-3]);} break; case 681: +#line 2866 "parse.y" { yyval = 0;} break; case 682: +#line 2874 "parse.y" { yyval = yyvsp[0]; } break; case 683: +#line 2876 "parse.y" { yyval = 0; } break; case 684: +#line 2880 "parse.y" { yyval = make_node (nod_plan_expr, 2, yyvsp[-3], make_list (yyvsp[-1])); } break; case 685: +#line 2884 "parse.y" { yyval = 0; } break; case 686: +#line 2886 "parse.y" { yyval = make_node (nod_merge, (int) 0, NULL); } break; case 687: +#line 2888 "parse.y" { yyval = make_node (nod_merge, (int) 0, NULL); } break; case 688: +#line 2894 "parse.y" { yyval = 0; } break; case 689: +#line 2896 "parse.y" { yyval = 0; } break; case 691: +#line 2901 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 692: +#line 2905 "parse.y" { yyval = make_node (nod_plan_item, 2, make_list (yyvsp[-1]), yyvsp[0]); } break; case 695: +#line 2911 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-1], yyvsp[0]); } break; case 696: +#line 2915 "parse.y" { yyval = make_node (nod_natural, (int) 0, NULL); } break; case 697: +#line 2917 "parse.y" { yyval = make_node (nod_index, 1, make_list (yyvsp[-1])); } break; case 698: +#line 2919 "parse.y" { yyval = make_node (nod_index_order, 1, yyvsp[0]); } break; case 700: +#line 2924 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 701: +#line 2932 "parse.y" { yyval = make_node (nod_insert, e_ins_count, yyvsp[-5], make_list (yyvsp[-4]), make_list (yyvsp[-1]), NULL); } break; case 702: +#line 2935 "parse.y" { yyval = make_node (nod_insert, e_ins_count, yyvsp[-2], yyvsp[-1], NULL, yyvsp[0]); } break; case 704: +#line 2940 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 707: +#line 2951 "parse.y" { yyval = make_node (nod_delete, e_del_count, yyvsp[-1], yyvsp[0], NULL); } break; case 708: +#line 2955 "parse.y" { yyval = make_node (nod_delete, e_del_count, yyvsp[-1], NULL, yyvsp[0]); } break; case 709: +#line 2959 "parse.y" { yyval = make_node (nod_cursor, e_cur_count, yyvsp[0], NULL, NULL); } break; case 712: +#line 2970 "parse.y" { yyval = make_node (nod_update, e_upd_count, yyvsp[-3], make_list (yyvsp[-1]), yyvsp[0], NULL); } break; case 713: +#line 2975 "parse.y" { yyval = make_node (nod_update, e_upd_count, yyvsp[-3], make_list (yyvsp[-1]), NULL, yyvsp[0]); } break; case 715: +#line 2981 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 716: +#line 2985 "parse.y" { yyval = make_node (nod_assign, 2, yyvsp[0], yyvsp[-2]); } break; case 719: +#line 2996 "parse.y" { yyval = make_node (nod_get_segment, e_blb_count, yyvsp[-4], yyvsp[-2], yyvsp[-1], yyvsp[0]); } break; case 720: +#line 2998 "parse.y" { yyval = make_node (nod_put_segment, e_blb_count, yyvsp[-4], yyvsp[-2], yyvsp[-1], yyvsp[0]); } break; case 721: +#line 3002 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 722: +#line 3004 "parse.y" { yyval = make_node (nod_list, 2, NULL, yyvsp[0]); } break; case 726: +#line 3013 "parse.y" { yyval = MAKE_constant ((STR) yyvsp[0], CONSTANT_SLONG); } break; case 727: +#line 3017 "parse.y" { yyval = yyvsp[0]; } break; case 729: +#line 3022 "parse.y" { yyval = MAKE_constant ((STR) yyvsp[0], CONSTANT_SLONG); } break; case 732: +#line 3031 "parse.y" { yyval = NULL; } break; case 733: +#line 3035 "parse.y" { yyval = make_list (yyvsp[-1]); } break; case 735: +#line 3040 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 737: +#line 3046 "parse.y" { yyval = NULL; } break; case 738: +#line 3050 "parse.y" { yyval = make_list (yyvsp[-1]); } break; case 740: +#line 3055 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 742: +#line 3061 "parse.y" { yyval = make_node (nod_field_name, (int) e_fln_count, yyvsp[-2], yyvsp[0]); } break; case 743: +#line 3064 "parse.y" { yyval = make_node (nod_field_name, (int) e_fln_count, yyvsp[-2], NULL); } break; case 744: +#line 3069 "parse.y" { yyval = make_node (nod_field_name, (int) e_fln_count, NULL, yyvsp[0]); } break; case 746: +#line 3077 "parse.y" { yyval = make_node (nod_field_name, (int) e_fln_count, yyvsp[-2], yyvsp[0]); } break; case 748: +#line 3085 "parse.y" { yyval = make_node (nod_or, 2, yyvsp[-2], yyvsp[0]); } break; case 749: +#line 3087 "parse.y" { yyval = make_node (nod_and, 2, yyvsp[-2], yyvsp[0]); } break; case 750: +#line 3089 "parse.y" { yyval = make_node (nod_not, 1, yyvsp[0]); } break; case 761: +#line 3103 "parse.y" { yyval = yyvsp[-1]; } break; case 762: +#line 3110 "parse.y" { yyval = make_node (nod_eql, 2, yyvsp[-2], yyvsp[0]); } break; case 763: +#line 3112 "parse.y" { yyval = make_node (nod_lss, 2, yyvsp[-2], yyvsp[0]); } break; case 764: +#line 3114 "parse.y" { yyval = make_node (nod_gtr, 2, yyvsp[-2], yyvsp[0]); } break; case 765: +#line 3116 "parse.y" { yyval = make_node (nod_geq, 2, yyvsp[-2], yyvsp[0]); } break; case 766: +#line 3118 "parse.y" { yyval = make_node (nod_leq, 2, yyvsp[-2], yyvsp[0]); } break; case 767: +#line 3120 "parse.y" { yyval = make_node (nod_leq, 2, yyvsp[-2], yyvsp[0]); } break; case 768: +#line 3122 "parse.y" { yyval = make_node (nod_geq, 2, yyvsp[-2], yyvsp[0]); } break; case 769: +#line 3124 "parse.y" { yyval = make_node (nod_neq, 2, yyvsp[-2], yyvsp[0]); } break; case 770: +#line 3131 "parse.y" { yyval = make_node (nod_eql_all, 2, yyvsp[-5], yyvsp[-1]); } break; case 771: +#line 3133 "parse.y" { yyval = make_node (nod_lss_all, 2, yyvsp[-5], yyvsp[-1]); } break; case 772: +#line 3135 "parse.y" { yyval = make_node (nod_gtr_all, 2, yyvsp[-5], yyvsp[-1]); } break; case 773: +#line 3137 "parse.y" { yyval = make_node (nod_geq_all, 2, yyvsp[-5], yyvsp[-1]); } break; case 774: +#line 3139 "parse.y" { yyval = make_node (nod_leq_all, 2, yyvsp[-5], yyvsp[-1]); } break; case 775: +#line 3141 "parse.y" { yyval = make_node (nod_leq_all, 2, yyvsp[-5], yyvsp[-1]); } break; case 776: +#line 3143 "parse.y" { yyval = make_node (nod_geq_all, 2, yyvsp[-5], yyvsp[-1]); } break; case 777: +#line 3145 "parse.y" { yyval = make_node (nod_neq_all, 2, yyvsp[-5], yyvsp[-1]); } break; case 778: +#line 3147 "parse.y" { yyval = make_node (nod_eql_any, 2, yyvsp[-5], yyvsp[-1]); } break; case 779: +#line 3149 "parse.y" { yyval = make_node (nod_lss_any, 2, yyvsp[-5], yyvsp[-1]); } break; case 780: +#line 3151 "parse.y" { yyval = make_node (nod_gtr_any, 2, yyvsp[-5], yyvsp[-1]); } break; case 781: +#line 3153 "parse.y" { yyval = make_node (nod_geq_any, 2, yyvsp[-5], yyvsp[-1]); } break; case 782: +#line 3155 "parse.y" { yyval = make_node (nod_leq_any, 2, yyvsp[-5], yyvsp[-1]); } break; case 783: +#line 3157 "parse.y" { yyval = make_node (nod_leq_any, 2, yyvsp[-5], yyvsp[-1]); } break; case 784: +#line 3159 "parse.y" { yyval = make_node (nod_geq_any, 2, yyvsp[-5], yyvsp[-1]); } break; case 785: +#line 3161 "parse.y" { yyval = make_node (nod_neq_any, 2, yyvsp[-5], yyvsp[-1]); } break; case 788: +#line 3172 "parse.y" { yyval = make_node (nod_between, 3, yyvsp[-4], yyvsp[-2], yyvsp[0]); } break; case 789: +#line 3174 "parse.y" { yyval = make_node (nod_not, 1, make_node (nod_between, 3, yyvsp[-5], yyvsp[-2], yyvsp[0])); } break; case 790: +#line 3179 "parse.y" { yyval = make_node (nod_like, 2, yyvsp[-2], yyvsp[0]); } break; case 791: +#line 3181 "parse.y" { yyval = make_node (nod_not, 1, make_node (nod_like, 2, yyvsp[-3], yyvsp[0])); } break; case 792: +#line 3183 "parse.y" { yyval = make_node (nod_like, 3, yyvsp[-4], yyvsp[-2], yyvsp[0]); } break; case 793: +#line 3185 "parse.y" { yyval = make_node (nod_not, 1, make_node (nod_like, 3, yyvsp[-5], yyvsp[-2], yyvsp[0])); } break; case 794: +#line 3190 "parse.y" { yyval = make_node (nod_eql_any, 2, yyvsp[-2], yyvsp[0]); } break; case 795: +#line 3192 "parse.y" { yyval = make_node (nod_not, 1, make_node (nod_eql_any, 2, yyvsp[-3], yyvsp[0])); } break; case 796: +#line 3196 "parse.y" { yyval = make_node (nod_containing, 2, yyvsp[-2], yyvsp[0]); } break; case 797: +#line 3198 "parse.y" { yyval = make_node (nod_not, 1, make_node (nod_containing, 2, yyvsp[-3], yyvsp[0])); } break; case 798: +#line 3202 "parse.y" { yyval = make_node (nod_starting, 2, yyvsp[-2], yyvsp[0]); } break; case 799: +#line 3204 "parse.y" { yyval = make_node (nod_not, 1, make_node (nod_starting, 2, yyvsp[-3], yyvsp[0])); } break; case 800: +#line 3206 "parse.y" { yyval = make_node (nod_starting, 2, yyvsp[-3], yyvsp[0]); } break; case 801: +#line 3208 "parse.y" { yyval = make_node (nod_not, 1, make_node (nod_starting, 2, yyvsp[-4], yyvsp[0])); } break; case 802: +#line 3212 "parse.y" { yyval = make_node (nod_exists, 1, yyvsp[-1]); } break; case 803: +#line 3216 "parse.y" { yyval = make_node (nod_singular, 1, yyvsp[-1]); } break; case 804: +#line 3220 "parse.y" { yyval = make_node (nod_missing, 1, yyvsp[-2]); } break; case 805: +#line 3222 "parse.y" { yyval = make_node (nod_not, 1, make_node (nod_missing, 1, yyvsp[-3])); } break; case 807: +#line 3230 "parse.y" { yyval = make_list (yyvsp[-1]); } break; case 808: +#line 3234 "parse.y" { yyval = yyvsp[-1]; } break; case 809: +#line 3245 "parse.y" { yyval = make_node (nod_select_expr, e_sel_count, yyvsp[-7], yyvsp[-6], make_list (yyvsp[-5]), yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0], NULL); } break; case 810: +#line 3257 "parse.y" { yyval = make_node (nod_select_expr, e_sel_count, yyvsp[-7], yyvsp[-6], make_list (yyvsp[-5]), yyvsp[-4], yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0], MAKE_constant ((STR) 1, CONSTANT_SLONG)); } break; case 820: +#line 3275 "parse.y" { yyval = make_node (nod_negate, 1, yyvsp[0]); } break; case 821: +#line 3277 "parse.y" { yyval = yyvsp[0]; } break; case 822: +#line 3279 "parse.y" { if (client_dialect >= SQL_DIALECT_V6_TRANSITION) yyval = make_node (nod_add2, 2, yyvsp[-2], yyvsp[0]); @@ -7404,12 +8002,15 @@ case 822: } break; case 823: +#line 3286 "parse.y" { yyval = make_node (nod_concatenate, 2, yyvsp[-2], yyvsp[0]); } break; case 824: +#line 3288 "parse.y" { yyval = make_node (nod_collate, e_coll_count, (NOD) yyvsp[0], yyvsp[-2]); } break; case 825: +#line 3290 "parse.y" { if (client_dialect >= SQL_DIALECT_V6_TRANSITION) yyval = make_node (nod_subtract2, 2, yyvsp[-2], yyvsp[0]); @@ -7418,6 +8019,7 @@ case 825: } break; case 826: +#line 3297 "parse.y" { if (client_dialect >= SQL_DIALECT_V6_TRANSITION) yyval = make_node (nod_multiply2, 2, yyvsp[-2], yyvsp[0]); @@ -7426,6 +8028,7 @@ case 826: } break; case 827: +#line 3304 "parse.y" { if (client_dialect >= SQL_DIALECT_V6_TRANSITION) yyval = make_node (nod_divide2, 2, yyvsp[-2], yyvsp[0]); @@ -7434,29 +8037,37 @@ case 827: } break; case 828: +#line 3311 "parse.y" { yyval = yyvsp[-1]; } break; case 829: +#line 3313 "parse.y" { yyval = yyvsp[-1]; } break; case 832: +#line 3321 "parse.y" { yyval = yyvsp[0]; } break; case 833: +#line 3323 "parse.y" { yyval = make_node (nod_dbkey, 1, NULL); } break; case 834: +#line 3325 "parse.y" { yyval = make_node (nod_dbkey, 1, yyvsp[-2]); } break; case 835: +#line 3327 "parse.y" { yyval = make_node (nod_dom_value, 0, NULL); } break; case 836: +#line 3331 "parse.y" { yyval = yyvsp[0]; } break; case 837: +#line 3336 "parse.y" { if (client_dialect < SQL_DIALECT_V6_TRANSITION) ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) -104, @@ -7474,6 +8085,7 @@ case 837: } break; case 838: +#line 3352 "parse.y" { if (client_dialect < SQL_DIALECT_V6_TRANSITION) ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) -104, @@ -7491,36 +8103,47 @@ case 838: } break; case 839: +#line 3368 "parse.y" { yyval = make_node (nod_current_timestamp, 0, NULL); } break; case 840: +#line 3372 "parse.y" { yyval = make_node (nod_array, 2, yyvsp[-3], make_list (yyvsp[-1])); } break; case 842: +#line 3377 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 844: +#line 3382 "parse.y" { yyval = make_node (nod_negate, 1, yyvsp[0]); } break; case 845: +#line 3386 "parse.y" { yyval = MAKE_constant ((STR) yyvsp[0], CONSTANT_STRING); } break; case 846: +#line 3388 "parse.y" { yyval = MAKE_constant ((STR) yyvsp[0], CONSTANT_SLONG); } break; case 847: +#line 3390 "parse.y" { yyval = MAKE_constant ((STR) yyvsp[0], CONSTANT_DOUBLE); } break; case 848: +#line 3392 "parse.y" { yyval = MAKE_constant ((STR) yyvsp[0], CONSTANT_SINT64); } break; case 849: +#line 3394 "parse.y" { yyval = MAKE_constant ((STR) yyvsp[0], CONSTANT_SINT64); } break; case 851: +#line 3399 "parse.y" { yyval = MAKE_str_constant ((STR) yyvsp[0], att_charset); } break; case 852: +#line 3401 "parse.y" { if (client_dialect < SQL_DIALECT_V6_TRANSITION) ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) -104, @@ -7538,6 +8161,7 @@ case 852: } break; case 853: +#line 3417 "parse.y" { if (client_dialect < SQL_DIALECT_V6_TRANSITION) ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) -104, @@ -7555,94 +8179,119 @@ case 853: } break; case 854: +#line 3433 "parse.y" { yyval = MAKE_constant ((STR) yyvsp[0], CONSTANT_TIMESTAMP); } break; case 860: +#line 3443 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 861: +#line 3445 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 862: +#line 3447 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 863: +#line 3449 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 864: +#line 3451 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 865: +#line 3455 "parse.y" { yyval = make_node (nod_parameter, 0, NULL); } break; case 866: +#line 3459 "parse.y" { yyval = make_node (nod_user_name, 0, NULL); } break; case 867: +#line 3461 "parse.y" { yyval = make_node (nod_user_name, 0, NULL); } break; case 868: +#line 3465 "parse.y" { yyval = make_node (nod_current_role, 0, NULL); } break; case 869: +#line 3469 "parse.y" { yyval = make_node (nod_internal_info, e_internal_info_count, MAKE_constant ((STR) 1, CONSTANT_SLONG)); } break; case 870: +#line 3472 "parse.y" { yyval = make_node (nod_internal_info, e_internal_info_count, MAKE_constant ((STR) 2, CONSTANT_SLONG)); } break; case 871: +#line 3477 "parse.y" { yyval = yyvsp[0]; } break; case 872: +#line 3479 "parse.y" { ((STR) yyvsp[0])->str_charset = (TEXT *) yyvsp[-1]; yyval = yyvsp[0]; } break; case 874: +#line 3485 "parse.y" { yyval = (NOD) - (SLONG) yyvsp[0]; } break; case 875: +#line 3489 "parse.y" { if ((SLONG) yyvsp[0] > SHRT_POS_MAX) yyabandon (-842, isc_expec_short); /* Short integer expected */ yyval = yyvsp[0];} break; case 876: +#line 3496 "parse.y" { if ((SLONG) yyvsp[0] > SHRT_NEG_MAX) yyabandon (-842, isc_expec_short); /* Short integer expected */ yyval = yyvsp[0];} break; case 877: +#line 3503 "parse.y" { if ((SLONG) yyvsp[0] == 0) yyabandon (-842, isc_expec_positive); /* Positive number expected */ yyval = yyvsp[0];} break; case 878: +#line 3510 "parse.y" { if ((SLONG) yyvsp[0] > SHRT_UNSIGNED_MAX) yyabandon (-842, isc_expec_ushort); /* Unsigned short integer expected */ yyval = yyvsp[0];} break; case 880: +#line 3518 "parse.y" { yyval = (NOD) - (SLONG) yyvsp[0]; } break; case 881: +#line 3522 "parse.y" { yyval = yyvsp[0];} break; case 886: +#line 3534 "parse.y" { yyval = make_node (nod_agg_count, 0, NULL); } break; case 887: +#line 3536 "parse.y" { yyval = make_node (nod_agg_count, 1, yyvsp[-1]); } break; case 888: +#line 3538 "parse.y" { yyval = make_flag_node (nod_agg_count, NOD_AGG_DISTINCT, 1, yyvsp[-1]); } break; case 889: +#line 3541 "parse.y" { if (client_dialect >= SQL_DIALECT_V6_TRANSITION) yyval = make_node (nod_agg_total2, 1, yyvsp[-1]); @@ -7651,6 +8300,7 @@ case 889: } break; case 890: +#line 3548 "parse.y" { if (client_dialect >= SQL_DIALECT_V6_TRANSITION) yyval = make_flag_node (nod_agg_total2, @@ -7661,6 +8311,7 @@ case 890: } break; case 891: +#line 3557 "parse.y" { if (client_dialect >= SQL_DIALECT_V6_TRANSITION) yyval = make_node (nod_agg_average2, 1, yyvsp[-1]); @@ -7669,6 +8320,7 @@ case 891: } break; case 892: +#line 3564 "parse.y" { if (client_dialect >= SQL_DIALECT_V6_TRANSITION) yyval = make_flag_node (nod_agg_average2, @@ -7679,18 +8331,23 @@ case 892: } break; case 893: +#line 3573 "parse.y" { yyval = make_node (nod_agg_min, 1, yyvsp[-1]); } break; case 894: +#line 3575 "parse.y" { yyval = make_node (nod_agg_min, 1, yyvsp[-1]); } break; case 895: +#line 3577 "parse.y" { yyval = make_node (nod_agg_max, 1, yyvsp[-1]); } break; case 896: +#line 3579 "parse.y" { yyval = make_node (nod_agg_max, 1, yyvsp[-1]); } break; case 897: +#line 3585 "parse.y" { if (client_dialect >= SQL_DIALECT_V6_TRANSITION) yyval = make_node (nod_gen_id2, 2, yyvsp[-3], yyvsp[-1]); @@ -7699,89 +8356,116 @@ case 897: } break; case 898: +#line 3594 "parse.y" { yyval = make_node (nod_extract, e_extract_count, yyvsp[-3], yyvsp[-1]); } break; case 899: +#line 3601 "parse.y" { yyval = make_node (nod_substr, e_substr_count, yyvsp[-3], MAKE_constant ((STR) ((SLONG)(yyvsp[-1]) - 1), CONSTANT_SLONG), MAKE_constant ((STR) SHRT_POS_MAX, CONSTANT_SLONG)); } break; case 900: +#line 3605 "parse.y" { yyval = make_node (nod_substr, e_substr_count, yyvsp[-5], MAKE_constant ((STR) ((SLONG)(yyvsp[-3]) - 1), CONSTANT_SLONG), MAKE_constant ((STR) (yyvsp[-1]), CONSTANT_SLONG)); } break; case 901: +#line 3609 "parse.y" { yyval = make_node (nod_upcase, 1, yyvsp[-1]); } break; case 902: +#line 3613 "parse.y" { yyval = make_node (nod_udf, 2, yyvsp[-3], yyvsp[-1]); } break; case 903: +#line 3615 "parse.y" { yyval = make_node (nod_udf, 1, yyvsp[-2]); } break; case 904: +#line 3619 "parse.y" { yyval = make_node (nod_cast, e_cast_count, yyvsp[-1], yyvsp[-3]); } break; case 907: +#line 3629 "parse.y" { yyval = make_node (nod_searched_case, 2, make_node (nod_list, 2, make_node (nod_eql, 2, yyvsp[-3], yyvsp[-1]), make_node (nod_null, 0, NULL)), yyvsp[-3]); } break; case 908: +#line 3633 "parse.y" { yyval = make_node (nod_coalesce, 2, yyvsp[-3], yyvsp[-1]); } break; case 911: +#line 3641 "parse.y" { yyval = make_node (nod_simple_case, 3, yyvsp[-2], make_list(yyvsp[-1]), make_node (nod_null, 0, NULL)); } break; case 912: +#line 3643 "parse.y" { yyval = make_node (nod_simple_case, 3, yyvsp[-4], make_list(yyvsp[-3]), yyvsp[-1]); } break; case 913: +#line 3647 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 914: +#line 3649 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-4], make_node (nod_list, 2, yyvsp[-2], yyvsp[0])); } break; case 915: +#line 3653 "parse.y" { yyval = make_node (nod_searched_case, 2, make_list(yyvsp[-1]), make_node (nod_null, 0, NULL)); } break; case 916: +#line 3655 "parse.y" { yyval = make_node (nod_searched_case, 2, make_list(yyvsp[-3]), yyvsp[-1]); } break; case 917: +#line 3659 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-2], yyvsp[0]); } break; case 918: +#line 3661 "parse.y" { yyval = make_node (nod_list, 2, yyvsp[-4], make_node (nod_list, 2, yyvsp[-2], yyvsp[0])); } break; case 922: +#line 3674 "parse.y" { yyval = MAKE_constant ((STR)blr_extract_year, CONSTANT_SLONG); } break; case 923: +#line 3676 "parse.y" { yyval = MAKE_constant ((STR)blr_extract_month, CONSTANT_SLONG); } break; case 924: +#line 3678 "parse.y" { yyval = MAKE_constant ((STR)blr_extract_day, CONSTANT_SLONG); } break; case 925: +#line 3680 "parse.y" { yyval = MAKE_constant ((STR)blr_extract_hour, CONSTANT_SLONG); } break; case 926: +#line 3682 "parse.y" { yyval = MAKE_constant ((STR)blr_extract_minute, CONSTANT_SLONG); } break; case 927: +#line 3684 "parse.y" { yyval = MAKE_constant ((STR)blr_extract_second, CONSTANT_SLONG); } break; case 928: +#line 3686 "parse.y" { yyval = MAKE_constant ((STR)blr_extract_weekday, CONSTANT_SLONG); } break; case 929: +#line 3688 "parse.y" { yyval = MAKE_constant ((STR)blr_extract_yearday, CONSTANT_SLONG); } break; case 932: +#line 3696 "parse.y" { yyval = make_node (nod_null, 0, NULL); } break; +#line 8465 "y.tab.c" } DSQL_DSQL_yyssp -= yym; yystate = *DSQL_DSQL_yyssp; diff --git a/src/dsql/parse.y b/src/dsql/parse.y index 97b5e46f55..fbfbffa3e9 100644 --- a/src/dsql/parse.y +++ b/src/dsql/parse.y @@ -3829,13 +3829,13 @@ for (token = KEYWORD_getTokens(); token->tok_string; ++token) SYM symbol; STR str_; - symbol = new(*DSQL_permanent_pool, 0) sym; + symbol = FB_NEW_RPT(*DSQL_permanent_pool, 0) sym; symbol->sym_string = (TEXT *) token->tok_string; symbol->sym_length = strlen (token->tok_string); symbol->sym_type = SYM_keyword; symbol->sym_keyword = token->tok_ident; symbol->sym_version = token->tok_version; - str_ = new(*DSQL_permanent_pool, symbol->sym_length) str; + str_ = FB_NEW_RPT(*DSQL_permanent_pool, symbol->sym_length) str; str_->str_length = symbol->sym_length; strncpy ((char*)str_->str_data, (char*)symbol->sym_string, symbol->sym_length); symbol->sym_object = (void *) str_; @@ -3974,12 +3974,12 @@ tdsql = GET_THREAD_DATA; if (field_name == NULL) { - field = new (*tdsql->tsql_default, sizeof (INTERNAL_FIELD_NAME)) fld; + field = FB_NEW_RPT(*tdsql->tsql_default, sizeof (INTERNAL_FIELD_NAME)) fld; strcpy (field->fld_name, (TEXT*) INTERNAL_FIELD_NAME); return field; } string = (STR) field_name->nod_arg [1]; -field = new(*tdsql->tsql_default, strlen ((SCHAR*) string->str_data)) fld; +field = FB_NEW_RPT(*tdsql->tsql_default, strlen ((SCHAR*) string->str_data)) fld; strcpy (field->fld_name, (TEXT*) string->str_data); return field; @@ -4003,7 +4003,7 @@ TSQL tdsql; tdsql = GET_THREAD_DATA; -temp_file = new(*tdsql->tsql_default) fil; +temp_file = FB_NEW(*tdsql->tsql_default) fil; return temp_file; } @@ -4039,7 +4039,7 @@ for (l = 0, temp = stack; temp; temp = temp->lls_next) l++; old = node; -node = new(*tdsql->tsql_default, l) nod; +node = FB_NEW_RPT(*tdsql->tsql_default, l) nod; node->nod_count = l; node->nod_type = nod_list; node->nod_flags = old->nod_flags; @@ -4074,7 +4074,7 @@ TSQL tdsql; tdsql = GET_THREAD_DATA; -node = new(*tdsql->tsql_default, count) nod; +node = FB_NEW_RPT(*tdsql->tsql_default, count) nod; node->nod_type = type; node->nod_line = (USHORT) lines_bk; node->nod_column = (USHORT) (last_token_bk - line_start_bk + 1); @@ -4111,7 +4111,7 @@ TSQL tdsql; tdsql = GET_THREAD_DATA; -node = new(*tdsql->tsql_default, count) nod; +node = FB_NEW_RPT(*tdsql->tsql_default, count) nod; node->nod_type = type; node->nod_flags = flag; node->nod_line = (USHORT) lines_bk; diff --git a/src/dsql/pass1.cpp b/src/dsql/pass1.cpp index 4abcb7da93..f223731dab 100644 --- a/src/dsql/pass1.cpp +++ b/src/dsql/pass1.cpp @@ -296,7 +296,7 @@ CTX PASS1_make_context( REQ request, NOD relation_node) } /* Set up context block */ - context = new(*tdsql->tsql_default) ctx; + context = FB_NEW(*tdsql->tsql_default) ctx; context->ctx_relation = relation; context->ctx_procedure = procedure; context->ctx_request = request; @@ -377,7 +377,7 @@ CTX PASS1_make_context( REQ request, NOD relation_node) if (count) { // Initialize this stack variable, and make it look like a node - std::auto_ptr desc_node(new(*tdsql->tsql_default, 0) nod); + std::auto_ptr desc_node(FB_NEW_RPT(*tdsql->tsql_default, 0) nod); for (input = context->ctx_proc_inputs->nod_arg, field = procedure->prc_inputs; @@ -1073,7 +1073,7 @@ NOD PASS1_statement(REQ request, NOD input, USHORT proc_flag) ERRD_post(gds_prcmismat, gds_arg_string, name->str_data, 0); if (count) { // Initialize this stack variable, and make it look like a node - std::auto_ptr desc_node(new(*getDefaultMemoryPool(), 0) nod); + std::auto_ptr desc_node(FB_NEW_RPT(*getDefaultMemoryPool(), 0) nod); for (ptr = node->nod_arg[e_exe_inputs]->nod_arg, field = request->req_procedure->prc_inputs; @@ -2590,10 +2590,10 @@ static void pass1_blob( REQ request, NOD input) request->req_type = (input->nod_type == nod_get_segment) ? REQ_GET_SEGMENT : REQ_PUT_SEGMENT; - request->req_blob = blob = new(*tdsql->tsql_default) blb; + request->req_blob = blob = FB_NEW(*tdsql->tsql_default) blb; blob->blb_field = field; blob->blb_open_in_msg = request->req_send; - blob->blb_open_out_msg = new(*tdsql->tsql_default) msg; + blob->blb_open_out_msg = FB_NEW(*tdsql->tsql_default) msg; blob->blb_segment_msg = request->req_receive; /* Create a parameter for the blob segment */ @@ -2714,7 +2714,7 @@ static NOD pass1_collate( REQ request, NOD sub1, STR collation) node = MAKE_node(nod_cast, e_cast_count); - field = new(*tdsql->tsql_default, 1) fld; + field = FB_NEW_RPT(*tdsql->tsql_default, 1) fld; field->fld_name[0] = 0; node->nod_arg[e_cast_target] = (NOD) field; node->nod_arg[e_cast_source] = sub1; @@ -3540,7 +3540,7 @@ static NOD pass1_alias_list( REQ request, NOD alias_list) /* make up a dummy context to hold the resultant relation */ - new_context = new(*tdsql->tsql_default) ctx; + new_context = FB_NEW(*tdsql->tsql_default) ctx; new_context->ctx_context = context->ctx_context; new_context->ctx_relation = relation; @@ -3553,7 +3553,7 @@ static NOD pass1_alias_list( REQ request, NOD alias_list) alias_length += static_cast < USHORT > (((STR) * arg)->str_length); } - alias = new(*tdsql->tsql_default, alias_length) str; + alias = FB_NEW_RPT(*tdsql->tsql_default, alias_length) str; alias->str_length = alias_length; p = new_context->ctx_alias = (TEXT *) alias->str_data; @@ -3715,14 +3715,14 @@ static NOD pass1_rse( REQ request, NOD input, NOD order) sub = sub->nod_arg[e_alias_value]; if (aggregate_found(request, sub, &proj)) { - parent_context = new(*tdsql->tsql_default) ctx; + parent_context = FB_NEW(*tdsql->tsql_default) ctx; break; } } if (!parent_context && (input->nod_arg[e_sel_group] || input->nod_arg[e_sel_having])) - parent_context = new(*tdsql->tsql_default) ctx; + parent_context = FB_NEW(*tdsql->tsql_default) ctx; if (parent_context) { parent_context->ctx_context = request->req_context_number++; @@ -4290,7 +4290,7 @@ static NOD pass1_union( REQ request, NOD input, NOD order_list) /* generate a context for the union itself */ - union_context = new(*tdsql->tsql_default) ctx; + union_context = FB_NEW(*tdsql->tsql_default) ctx; union_context->ctx_context = request->req_context_number++; /* generate the list of fields to select */ @@ -4347,7 +4347,7 @@ static NOD pass1_union( REQ request, NOD input, NOD order_list) ptr < end; ptr++) { *ptr = map_node = MAKE_node(nod_map, e_map_count); map_node->nod_arg[e_map_context] = (NOD) union_context; - map_ = new(*tdsql->tsql_default) map; + map_ = FB_NEW(*tdsql->tsql_default) map; map_node->nod_arg[e_map_map] = (NOD) map_; /* set up the MAP between the sub-rses and the union context */ @@ -4584,7 +4584,7 @@ static NOD post_map( NOD node, CTX context) break; if (!map_) { - map_ = new(*tdsql->tsql_default) map; + map_ = FB_NEW(*tdsql->tsql_default) map; map_->map_position = count; map_->map_next = context->ctx_map; context->ctx_map = map_; diff --git a/src/include/fb_blk.h b/src/include/fb_blk.h index e793cc75eb..a7e2dddedc 100644 --- a/src/include/fb_blk.h +++ b/src/include/fb_blk.h @@ -17,13 +17,20 @@ template class pool_alloc : public blk { public: +#ifdef DEBUG_GDS_ALLOC + void* operator new(size_t s, MemoryPool& p, char* file, int line) + { return p.allocate(s, TYPE, file, line); } + void* operator new[](size_t s, MemoryPool& p, char* file, int line) + { return p.allocate(s, TYPE, file, line); } +#else void* operator new(size_t s, MemoryPool& p ) { return p.allocate(s, TYPE); } - void operator delete(void* mem, MemoryPool& p) - { if (mem) p.deallocate(mem); } - void* operator new[](size_t s, MemoryPool& p) { return p.allocate(s, TYPE); } +#endif + + void operator delete(void* mem, MemoryPool& p) + { if (mem) p.deallocate(mem); } void operator delete[](void* mem, MemoryPool& p) { if (mem) p.deallocate(mem); } @@ -40,8 +47,13 @@ template class pool_alloc_rpt : public blk { public: +#ifdef DEBUG_GDS_ALLOC + void* operator new(size_t s, MemoryPool& p, int rpt, char *file, int line) + { return p.allocate(s + sizeof(RPT)*rpt, TYPE, file, line); } +#else void* operator new(size_t s, MemoryPool& p, int rpt) { return p.allocate(s + sizeof(RPT)*rpt, TYPE); } +#endif void operator delete(void* mem, MemoryPool& p,int rpt) { if (mem) p.deallocate(mem); } void operator delete(void* mem) { if (mem) MemoryPool::deallocate(mem); } diff --git a/src/jrd/ail.cpp b/src/jrd/ail.cpp index 8731f0113c..0852ae1f23 100644 --- a/src/jrd/ail.cpp +++ b/src/jrd/ail.cpp @@ -639,7 +639,7 @@ void AIL_get_file_list(LLS * stack) continue; temp_fname = LOGF_NAME(logf); fname_term_length = strlen(temp_fname) + 1; - fname = new(*dbb->dbb_permanent, fname_term_length) str(); + fname = FB_NEW_RPT(*dbb->dbb_permanent, fname_term_length) str(); MOVE_FAST(temp_fname, (SCHAR*)fname->str_data, fname_term_length); LLS_PUSH(fname, stack); } @@ -675,7 +675,7 @@ void AIL_get_file_list(LLS * stack) while (TRUE) { if (!(log_flags & WALFH_RAW)) { fname_term_length = strlen(curr_name) + 1; - fname = new(*dbb->dbb_permanent, fname_term_length) str(); + fname = FB_NEW_RPT(*dbb->dbb_permanent, fname_term_length) str(); MOVE_FAST(curr_name, (SCHAR*)fname->str_data, fname_term_length); LLS_PUSH(fname, stack); } diff --git a/src/jrd/all.cpp b/src/jrd/all.cpp index 4a66820d05..606afc2f1a 100644 --- a/src/jrd/all.cpp +++ b/src/jrd/all.cpp @@ -136,7 +136,11 @@ TEXT* ALL_cstring(TEXT* in_string) } length = strlen(in_string); +#ifdef DEBUG_GDS_ALLOC + string = (STR) pool->allocate(type_str, length, __FILE__, __LINE__); +#else string = (STR) pool->allocate(type_str, length); +#endif /* TMN: Here we should really have the following assert */ /* assert(length <= MAX_USHORT); */ string->str_length = (USHORT) length; @@ -205,7 +209,7 @@ void ALL_init(void) dbb->dbb_permanent->setExtendSize(PERM_EXTEND_SIZE); dbb->dbb_pools[0] = pool; - dbb->dbb_bufferpool = new(*pool) JrdMemoryPool(CACH_EXTEND_SIZE); + dbb->dbb_bufferpool = FB_NEW(*pool) JrdMemoryPool(CACH_EXTEND_SIZE); dbb->dbb_pools[1] = dbb->dbb_bufferpool; } diff --git a/src/jrd/blb.cpp b/src/jrd/blb.cpp index a319862aff..a004c815ed 100644 --- a/src/jrd/blb.cpp +++ b/src/jrd/blb.cpp @@ -32,7 +32,7 @@ * readonly databases. */ /* -$Id: blb.cpp,v 1.9 2002-06-29 13:00:56 dimitr Exp $ +$Id: blb.cpp,v 1.10 2002-09-25 17:12:09 skidder Exp $ */ #include "firebird.h" @@ -228,7 +228,7 @@ BLB BLB_create2(TDBB tdbb, if (to_charset == CS_dynamic) to_charset = tdbb->tdbb_attachment->att_charset; if ((to_charset != CS_NONE) && (from_charset != to_charset)) { - filter = new(*dbb->dbb_permanent) blf(); + filter = FB_NEW(*dbb->dbb_permanent) blf(); filter->blf_filter = reinterpret_cast(filter_transliterate_text); filter_required = TRUE; @@ -670,7 +670,11 @@ SLONG BLB_get_slice(TDBB tdbb, /* Get someplace to put data */ - data = (UCHAR*) dbb->dbb_permanent->allocate(desc->ads_total_length); + data = (UCHAR*) dbb->dbb_permanent->allocate(desc->ads_total_length, 0 +#ifdef DEBUG_GDS_ALLOC + ,__FILE__, __LINE__ +#endif + ); /* zero out memory, so that it does not have to be done for each element */ @@ -806,7 +810,7 @@ void DLL_EXPORT BLB_map_blobs(TDBB tdbb, BLB old_blob, BLB new_blob) dbb = tdbb->tdbb_database; CHECK_DBB(dbb); - new_map = new(*dbb->dbb_permanent) map(); + new_map = FB_NEW(*dbb->dbb_permanent) map(); new_map->map_old_blob = old_blob; new_map->map_new_blob = new_blob; @@ -1088,7 +1092,7 @@ BLB BLB_open2(TDBB tdbb, if (to_charset == CS_dynamic) to_charset = tdbb->tdbb_attachment->att_charset; if ((to_charset != CS_NONE) && (from_charset != to_charset)) { - filter = new(*dbb->dbb_permanent) blf(); + filter = FB_NEW(*dbb->dbb_permanent) blf(); filter->blf_filter = reinterpret_cast < STATUS (*) (USHORT, CTL) > (filter_transliterate_text); filter_required = TRUE; @@ -1580,7 +1584,7 @@ void BLB_scalar(TDBB tdbb, desc.dsc_address = (UCHAR*) temp; } else { temp_str = - new(*tdbb->tdbb_default, desc.dsc_length + DOUBLE_ALIGN - 1) str; + FB_NEW_RPT(*tdbb->tdbb_default, desc.dsc_length + DOUBLE_ALIGN - 1) str; desc.dsc_address = (UCHAR *) FB_ALIGN((U_IPTR) temp_str->str_data, DOUBLE_ALIGN); } @@ -1633,7 +1637,7 @@ static ARR alloc_array(TRA transaction, ADS proto_desc) // Compute size and allocate block USHORT n = MAX(proto_desc->ads_struct_count, proto_desc->ads_dimensions); - ARR array = new(*transaction->tra_pool, n) arr(); + ARR array = FB_NEW_RPT(*transaction->tra_pool, n) arr(); // Copy prototype descriptor @@ -1648,7 +1652,11 @@ static ARR alloc_array(TRA transaction, ADS proto_desc) // Allocate large block to hold array array->arr_data = - (UCHAR*)dbb->dbb_permanent->allocate(array->arr_desc.ads_total_length); + (UCHAR*)dbb->dbb_permanent->allocate(array->arr_desc.ads_total_length, 0 +#ifdef DEBUG_GDS_ALLOC + ,__FILE__, __LINE__ +#endif + ); return array; } @@ -1672,7 +1680,7 @@ static BLB allocate_blob(TDBB tdbb, TRA transaction) /* Create a blob large enough to hold a single data page */ - BLB blob = new(*transaction->tra_pool, dbb->dbb_page_size) blb(); + BLB blob = FB_NEW_RPT(*transaction->tra_pool, dbb->dbb_page_size) blb(); blob->blb_attachment = tdbb->tdbb_attachment; blob->blb_next = transaction->tra_blobs; transaction->tra_blobs = blob; @@ -1769,7 +1777,7 @@ static STATUS blob_filter( USHORT action, return SUCCESS; case ACTION_alloc: - return (STATUS) new(*transaction->tra_pool) ctl(); + return (STATUS) FB_NEW(*transaction->tra_pool) ctl(); case ACTION_free: delete control; @@ -1867,7 +1875,7 @@ static BLB copy_blob(TDBB tdbb, BID source, REL relation, BID destination) #endif { - string = new(*tdbb->tdbb_default, input->blb_max_segment) str(); + string = FB_NEW_RPT(*tdbb->tdbb_default, input->blb_max_segment) str(); buff = (UCHAR *) string->str_data; } else { @@ -2409,7 +2417,7 @@ static void slice_callback(SLICE arg, ULONG count, DSC * descriptors) tdbb = GET_THREAD_DATA; tmp_len = array_desc->dsc_length; - tmp_buffer = new(*tdbb->tdbb_default, tmp_len) str(); + tmp_buffer = FB_NEW_RPT(*tdbb->tdbb_default, tmp_len) str(); len = MOV_make_string(slice_desc, INTL_TEXT_TYPE(*array_desc), &p, diff --git a/src/jrd/blob_filter.epp b/src/jrd/blob_filter.epp index ab3b8d4bed..df4bb9fefa 100644 --- a/src/jrd/blob_filter.epp +++ b/src/jrd/blob_filter.epp @@ -236,12 +236,12 @@ BLF DLL_EXPORT BLF_lookup_internal_filter(TDBB tdbb, SSHORT from, SSHORT to) if (to == BLOB_text && from >= 0 && from < sizeof(filters) / sizeof(filters[0])) { - result = new(*dbb->dbb_permanent) blf; + result = FB_NEW(*dbb->dbb_permanent) blf; result->blf_next = NULL; result->blf_from = from; result->blf_to = to; result->blf_filter = filters[from]; - exception_msg = new(*dbb->dbb_permanent, 100) str; + exception_msg = FB_NEW_RPT(*dbb->dbb_permanent, 100) str; // SIGN ISSUE, arg 1 sprintf((char*)exception_msg->str_data, "Exception occurred in system provided internal filters for filtering internal subtype %d to text.", diff --git a/src/jrd/block_cache.h b/src/jrd/block_cache.h index ab095e9d30..d47ec3c57f 100644 --- a/src/jrd/block_cache.h +++ b/src/jrd/block_cache.h @@ -2,6 +2,7 @@ #define _JRD_BLOCK_CACHE_H_ #include "../common/memory/memory_pool.h" +#include "../common/memory/allocators.h" #include "../jrd/smp_impl.h" template @@ -36,7 +37,7 @@ inline T* BlockCache::newBlock() return result; } lock.release(); - return new(pool) T; + return FB_NEW(pool) T; } template diff --git a/src/jrd/bookmark.cpp b/src/jrd/bookmark.cpp index 4b12ce250c..0ca311a6d9 100644 --- a/src/jrd/bookmark.cpp +++ b/src/jrd/bookmark.cpp @@ -64,7 +64,7 @@ BKM BKM_allocate(RSB rsb, USHORT length) /* allocate the bookmark and link it into the linked list hanging off the attachment block */ - bookmark = new(*dbb->dbb_permanent, length) bkm(); + bookmark = FB_NEW_RPT(*dbb->dbb_permanent, length) bkm(); attachment = tdbb->tdbb_attachment; bookmark->bkm_next = attachment->att_bookmarks; diff --git a/src/jrd/btr.cpp b/src/jrd/btr.cpp index fd2fdc1732..4fd9a50a33 100644 --- a/src/jrd/btr.cpp +++ b/src/jrd/btr.cpp @@ -21,7 +21,7 @@ * Contributor(s): ______________________________________. */ /* -$Id: btr.cpp,v 1.6 2002-09-24 12:57:07 eku Exp $ +$Id: btr.cpp,v 1.7 2002-09-25 17:12:09 skidder Exp $ */ #include "firebird.h" @@ -240,7 +240,7 @@ USHORT BTR_all(TDBB tdbb, if ((SLONG) (root->irt_count * sizeof(IDX)) > *idx_size) { size = (sizeof(IDX) * MAX_IDX) + ALIGNMENT; - *csb_idx_allocation = new_buffer = new(*dbb->dbb_permanent, size) str(); + *csb_idx_allocation = new_buffer = FB_NEW_RPT(*dbb->dbb_permanent, size) str(); buffer = *start_buffer = (IDX *) FB_ALIGN((U_IPTR) new_buffer->str_data, ALIGNMENT); *idx_size = size - ALIGNMENT; @@ -2263,7 +2263,11 @@ static USHORT compress_root(TDBB tdbb, IRT page) dbb = tdbb->tdbb_database; CHECK_DBB(dbb); - temp = (UCHAR *) tdbb->tdbb_default->allocate((SLONG) dbb->dbb_page_size); + temp = (UCHAR *) tdbb->tdbb_default->allocate((SLONG) dbb->dbb_page_size, 0 +#ifdef DEBUG_GDS_ALLOC + ,__FILE__,__LINE__ +#endif + ); MOVE_FASTER(page, temp, dbb->dbb_page_size); p = temp + dbb->dbb_page_size; diff --git a/src/jrd/cch.cpp b/src/jrd/cch.cpp index dcc7cbc55b..c4e95db87d 100644 --- a/src/jrd/cch.cpp +++ b/src/jrd/cch.cpp @@ -1414,7 +1414,7 @@ void CCH_init(TDBB tdbb, ULONG number) while (!bcb_) { try { - bcb_ = new(*dbb->dbb_bufferpool, number) bcb; + bcb_ = FB_NEW_RPT(*dbb->dbb_bufferpool, number) bcb; } catch(...) { /* If the buffer control block can't be allocated, memory is very low. Recalculate the number of buffers to account for @@ -1782,7 +1782,7 @@ LCK CCH_page_lock(TDBB tdbb) SET_TDBB(tdbb); dbb = tdbb->tdbb_database; - lock = new(*dbb->dbb_bufferpool, sizeof(SLONG)) lck; + lock = FB_NEW_RPT(*dbb->dbb_bufferpool, sizeof(SLONG)) lck; lock->lck_type = LCK_bdb; lock->lck_owner_handle = LCK_get_owner_handle(tdbb, lock->lck_type); lock->lck_length = sizeof(SLONG); @@ -2459,7 +2459,11 @@ BOOLEAN CCH_write_all_shadows(TDBB tdbb, and set up to release it in case of error */ spare_buffer = - (SLONG *) dbb->dbb_bufferpool->allocate((SLONG) dbb->dbb_page_size); + (SLONG *) dbb->dbb_bufferpool->allocate((SLONG) dbb->dbb_page_size,0 +#ifdef DEBUG_GDS_ALLOC + ,__FILE__,__LINE__ +#endif + ); page = (PAG) spare_buffer; MOVE_FAST((UCHAR *) bdb->bdb_buffer, (UCHAR *) page, HDR_SIZE); @@ -2585,7 +2589,7 @@ static BDB alloc_bdb(TDBB tdbb, BCB bcb, UCHAR ** memory) SET_TDBB(tdbb); dbb = tdbb->tdbb_database; - bdb_ = new(*dbb->dbb_bufferpool) bdb; + bdb_ = FB_NEW(*dbb->dbb_bufferpool) bdb; bdb_->bdb_dbb = dbb; #ifndef PAGE_LATCHING @@ -2999,7 +3003,7 @@ static void THREAD_ROUTINE cache_reader(DBB dbb) tdbb->tdbb_default = dbb->dbb_bufferpool; tdbb->tdbb_status_vector = status_vector; tdbb->tdbb_quantum = QUANTUM; - tdbb->tdbb_attachment = new(*dbb->dbb_bufferpool) att(); + tdbb->tdbb_attachment = FB_NEW(*dbb->dbb_bufferpool) att(); tdbb->tdbb_attachment->att_database = dbb; /* This try block is specifically to protect the LCK_init call: if @@ -3167,7 +3171,7 @@ static void THREAD_ROUTINE cache_writer(DBB dbb) tdbb->tdbb_default = dbb->dbb_bufferpool; tdbb->tdbb_status_vector = status_vector; tdbb->tdbb_quantum = QUANTUM; - tdbb->tdbb_attachment = new(*dbb->dbb_bufferpool) att; + tdbb->tdbb_attachment = FB_NEW(*dbb->dbb_bufferpool) att; tdbb->tdbb_attachment->att_database = dbb; /* This try block is specifically to protect the LCK_init call: if @@ -3439,7 +3443,7 @@ static void check_precedence(TDBB tdbb, WIN * window, SLONG page) if ( (precedence = bcb->bcb_free) ) bcb->bcb_free = (PRE) precedence->pre_hi; else - precedence = new(*dbb->dbb_bufferpool) pre; + precedence = FB_NEW(*dbb->dbb_bufferpool) pre; precedence->pre_low = low; precedence->pre_hi = high; @@ -3707,7 +3711,7 @@ static void expand_buffers(TDBB tdbb, ULONG number) old = dbb->dbb_bcb; old_end = old->bcb_rpt + old->bcb_count; - BCB new_ = new(*dbb->dbb_bufferpool, number) bcb; + BCB new_ = FB_NEW_RPT(*dbb->dbb_bufferpool, number) bcb; new_->bcb_count = number; new_->bcb_free_minimum = (SSHORT) MIN(number / 4, 128); /* 25% clean page reserve */ new_->bcb_checkpoint = old->bcb_checkpoint; @@ -4322,7 +4326,7 @@ static SSHORT latch_bdb( lwt_ = (LWT) BLOCK(que, LWT, lwt_waiters); } else { - lwt_ = new(*dbb->dbb_bufferpool) lwt; + lwt_ = FB_NEW(*dbb->dbb_bufferpool) lwt; QUE_INIT(lwt_->lwt_waiters); ISC_event_init(&lwt_->lwt_event, 0, 0); } diff --git a/src/jrd/cmp.cpp b/src/jrd/cmp.cpp index 024f41d28c..3a4dd222c3 100644 --- a/src/jrd/cmp.cpp +++ b/src/jrd/cmp.cpp @@ -30,7 +30,7 @@ * This closes the heart of SF Bug #518282. */ /* -$Id: cmp.cpp,v 1.10 2002-09-19 16:02:56 skidder Exp $ +$Id: cmp.cpp,v 1.11 2002-09-25 17:12:09 skidder Exp $ */ #include "firebird.h" @@ -290,7 +290,7 @@ REQ DLL_EXPORT CMP_clone_request(TDBB tdbb, n = (USHORT) ((request->req_impure_size - REQ_SIZE + REQ_TAIL - 1) / REQ_TAIL); - clone = new(*request->req_pool, n) req; + clone = FB_NEW_RPT(*request->req_pool, n) req; (*vector)[level] = (BLK) clone; clone->req_attachment = tdbb->tdbb_attachment; clone->req_count = request->req_count; @@ -356,7 +356,7 @@ REQ DLL_EXPORT CMP_compile2(TDBB tdbb, UCHAR* blr, USHORT internal_flag) SET_TDBB(tdbb); JrdMemoryPool* old_pool = tdbb->tdbb_default; - JrdMemoryPool* new_pool = new(*tdbb->tdbb_database->dbb_permanent) + JrdMemoryPool* new_pool = FB_NEW(*tdbb->tdbb_database->dbb_permanent) JrdMemoryPool; tdbb->tdbb_default = new_pool; @@ -1636,13 +1636,13 @@ IDL DLL_EXPORT CMP_get_index_lock(TDBB tdbb, REL relation, USHORT id) if (index->idl_id == id) return index; - index = new(*dbb->dbb_permanent) idl(); + index = FB_NEW(*dbb->dbb_permanent) idl(); index->idl_next = relation->rel_index_locks; relation->rel_index_locks = index; index->idl_relation = relation; index->idl_id = id; - index->idl_lock = lock = new(*dbb->dbb_permanent, 0) lck; + index->idl_lock = lock = FB_NEW_RPT(*dbb->dbb_permanent, 0) lck; lock->lck_parent = dbb->dbb_lock; lock->lck_dbb = dbb; lock->lck_key.lck_long = relation->rel_id * 1000 + id; @@ -1724,7 +1724,7 @@ REQ DLL_EXPORT CMP_make_request(TDBB tdbb, CSB * csb_ptr) count of hold the impure areas. */ int n = (csb->csb_impure - REQ_SIZE + REQ_TAIL - 1) / REQ_TAIL; - request = new(*tdbb->tdbb_default, n) req; + request = FB_NEW_RPT(*tdbb->tdbb_default, n) req; request->req_count = csb->csb_n_stream; request->req_pool = tdbb->tdbb_default; request->req_impure_size = csb->csb_impure; @@ -1919,7 +1919,7 @@ int DLL_EXPORT CMP_post_access(TDBB tdbb, } - access = new(*tdbb->tdbb_default) acc; + access = FB_NEW(*tdbb->tdbb_default) acc; /* append the security class to the existing list */ if (last_entry) @@ -1979,7 +1979,7 @@ void DLL_EXPORT CMP_post_resource( if (resource->rsc_type == type && resource->rsc_id == id) return; - resource = new(*tdbb->tdbb_default) Rsc; + resource = FB_NEW(*tdbb->tdbb_default) Rsc; resource->rsc_next = *rsc_ptr; *rsc_ptr = resource; resource->rsc_type = type; @@ -2232,7 +2232,7 @@ static UCHAR *alloc_map(TDBB tdbb, CSB * csb, USHORT stream) SET_TDBB(tdbb); - string = new(*tdbb->tdbb_default, MAP_LENGTH) str; + string = FB_NEW_RPT(*tdbb->tdbb_default, MAP_LENGTH) str; string->str_length = MAP_LENGTH; (*csb)->csb_rpt[stream].csb_map = (UCHAR *) string->str_data; /* TMN: Here we should really have the following assert */ diff --git a/src/jrd/cvt2.cpp b/src/jrd/cvt2.cpp index 7282875731..44e0b1faef 100644 --- a/src/jrd/cvt2.cpp +++ b/src/jrd/cvt2.cpp @@ -616,7 +616,7 @@ SSHORT CVT2_blob_compare(DSC * arg1, DSC * arg2, FPTR_VOID err) #ifdef STACK_REDUCTION /* do a block allocate */ - temp_str = new (*tdbb->tdbb_default, sizeof(UCHAR) * (2 * BUFFER_LARGE)) str(); + temp_str = FB_NEW_RPT(*tdbb->tdbb_default, sizeof(UCHAR) * (2 * BUFFER_LARGE)) str(); buffer1 = temp_str->str_data; buffer2 = buffer1 + BUFFER_LARGE; #endif @@ -783,12 +783,12 @@ SSHORT CVT2_blob_compare(DSC * arg1, DSC * arg2, FPTR_VOID err) #ifdef STACK_REDUCTION /* do a block allocate */ - temp_str = new (*tdbb->tdbb_default, sizeof(UCHAR) * arg2->dsc_length) str(); + temp_str = FB_NEW_RPT(*tdbb->tdbb_default, sizeof(UCHAR) * arg2->dsc_length) str(); dbuf = temp_str->str_data; #else if (arg2->dsc_length > BUFFER_LARGE) { - temp_str = new (*tdbb->tdbb_default, sizeof(UCHAR) * arg2->dsc_length) str(); + temp_str = FB_NEW_RPT(*tdbb->tdbb_default, sizeof(UCHAR) * arg2->dsc_length) str(); dbuf = temp_str->str_data; } else @@ -916,7 +916,7 @@ USHORT CVT2_make_string2(DSC * desc, cs2, from_buf, from_len, err); tempptr = (UCHAR *) temp; if (needed_len > length) { - *ptr = new(*tdbb->tdbb_default, needed_len) str(); + *ptr = FB_NEW_RPT(*tdbb->tdbb_default, needed_len) str(); (*ptr)->str_length = needed_len; tempptr = (*ptr)->str_data; length = needed_len; diff --git a/src/jrd/dfw.epp b/src/jrd/dfw.epp index 31e4415253..836900770f 100644 --- a/src/jrd/dfw.epp +++ b/src/jrd/dfw.epp @@ -718,7 +718,7 @@ void DFW_post_work( TRA transaction, ENUM dfw_t type, DSC * desc, USHORT id) /* Not already posted, so do so now. */ - *ptr = work = new(*transaction->tra_pool, length) dfw; + *ptr = work = FB_NEW_RPT(*transaction->tra_pool, length) dfw; work->dfw_type = type; work->dfw_id = id; work->dfw_count = 1; @@ -1854,7 +1854,7 @@ static bool create_relation(TDBB tdbb, /* Take a relation lock on rel id -1 before actually generating a relation id. */ - work->dfw_lock = lock = new(*tdbb->tdbb_default, sizeof(SLONG)) lck; + work->dfw_lock = lock = FB_NEW_RPT(*tdbb->tdbb_default, sizeof(SLONG)) lck; lock->lck_dbb = dbb; lock->lck_attachment = tdbb->tdbb_attachment; lock->lck_length = sizeof(SLONG); @@ -3194,7 +3194,7 @@ static void get_procedure_dependencies(DFW work) if (procedure && !NULL_BLOB(blob_id)) { old_pool = tdbb->tdbb_default; - tdbb->tdbb_default = new(*dbb->dbb_permanent) JrdMemoryPool; + tdbb->tdbb_default = FB_NEW(*dbb->dbb_permanent) JrdMemoryPool; MET_get_dependencies(tdbb, (struct rel*)NULL_PTR, (TEXT*)NULL_PTR, @@ -3659,7 +3659,7 @@ static bool make_version(TDBB tdbb, SSHORT phase, DFW work, TRA transaction) /* Make a temporary field block */ - tfb_ = new(*tdbb->tdbb_default) tfb; + tfb_ = FB_NEW(*tdbb->tdbb_default) tfb; tfb_->tfb_next = stack; stack = tfb_; @@ -3702,7 +3702,7 @@ static bool make_version(TDBB tdbb, SSHORT phase, DFW work, TRA transaction) if (external_flag) { - tfb_ = new(*tdbb->tdbb_default) tfb; + tfb_ = FB_NEW(*tdbb->tdbb_default) tfb; tfb_->tfb_next = external; external = tfb_; assert(FLD.RDB$EXTERNAL_TYPE <= MAX_UCHAR); diff --git a/src/jrd/dyn_def.epp b/src/jrd/dyn_def.epp index d0ddcad9ec..d23322dd80 100644 --- a/src/jrd/dyn_def.epp +++ b/src/jrd/dyn_def.epp @@ -433,7 +433,7 @@ void DYN_define_constraint(GBL gbl, } unique_count++; - str_ = new(*tdbb->tdbb_default, sizeof(IDS.RDB$FIELD_NAME) - 1) str(); + str_ = FB_NEW_RPT(*tdbb->tdbb_default, sizeof(IDS.RDB$FIELD_NAME) - 1) str(); strcpy((char*)str_->str_data, IDS.RDB$FIELD_NAME); LLS_PUSH(str_, &field_list); END_FOR; @@ -1729,7 +1729,7 @@ void DYN_define_index(GBL gbl, break; case gds_dyn_fld_name: - str_ = new(*tdbb->tdbb_default, field_name_size - 1) str(); + str_ = FB_NEW_RPT(*tdbb->tdbb_default, field_name_size - 1) str(); DYN_get_string((TEXT**)ptr, (TEXT*)str_->str_data, field_name_size, TRUE); LLS_PUSH(str_, &seg_list); seg_count++; @@ -1837,7 +1837,7 @@ void DYN_define_index(GBL gbl, break; case gds_dyn_idx_ref_column: - str_ = new(*tdbb->tdbb_default, field_name_size - 1) str(); + str_ = FB_NEW_RPT(*tdbb->tdbb_default, field_name_size - 1) str(); DYN_get_string((TEXT**)ptr, (TEXT*)str_->str_data, field_name_size, TRUE); LLS_PUSH(str_, &field_list); referred_cols++; diff --git a/src/jrd/dyn_del.epp b/src/jrd/dyn_del.epp index ee0eb9c48f..d3d179f521 100644 --- a/src/jrd/dyn_del.epp +++ b/src/jrd/dyn_del.epp @@ -1501,7 +1501,7 @@ files = NULL; ERASE FIL; /**** - file = new(*tdbb->tdbb_default, sizeof (FIL.RDB$FILE_NAME) - 1) str(); + file = FB_NEW_RPT(*tdbb->tdbb_default, sizeof (FIL.RDB$FILE_NAME) - 1) str(); strcpy (file->str_data, FIL.RDB$FILE_NAME); LLS_PUSH (file, &files); ****/ diff --git a/src/jrd/evl.cpp b/src/jrd/evl.cpp index 6afbbae677..54cc319c16 100644 --- a/src/jrd/evl.cpp +++ b/src/jrd/evl.cpp @@ -19,7 +19,7 @@ * * All Rights Reserved. * Contributor(s): ______________________________________. - * $Id: evl.cpp,v 1.14 2002-09-17 05:58:35 eku Exp $ + * $Id: evl.cpp,v 1.15 2002-09-25 17:12:09 skidder Exp $ */ /* @@ -1821,7 +1821,7 @@ void DLL_EXPORT EVL_make_value(TDBB tdbb, DSC * desc, VLU value) } if (!string) { - string = value->vlu_string = new(*tdbb->tdbb_default, length) str(); + string = value->vlu_string = FB_NEW_RPT(*tdbb->tdbb_default, length) str(); string->str_length = length; } @@ -1867,11 +1867,11 @@ USHORT DLL_EXPORT EVL_mb_contains(TDBB tdbb, len2 = obj->to_wc(NULL, 0, p2, l2, &err_code, &err_pos); if (len1 > sizeof(buffer1)) { - buf1 = new(*tdbb->tdbb_default, len1) str(); + buf1 = FB_NEW_RPT(*tdbb->tdbb_default, len1) str(); pp1 = (USHORT *) buf1->str_data; } if (len2 > sizeof(buffer2)) { - buf2 = new(*tdbb->tdbb_default, len2) str(); + buf2 = FB_NEW_RPT(*tdbb->tdbb_default, len2) str(); pp2 = (USHORT *) buf2->str_data; } @@ -1924,11 +1924,11 @@ USHORT DLL_EXPORT EVL_mb_like(TDBB tdbb, len1 = obj->to_wc(NULL, 0, p1, l1, &err_code, &err_pos); len2 = obj->to_wc(NULL, 0, p2, l2, &err_code, &err_pos); if (len1 > sizeof(buffer1)) { - buf1 = new(*tdbb->tdbb_default, len1) str(); + buf1 = FB_NEW_RPT(*tdbb->tdbb_default, len1) str(); pp1 = (USHORT *) buf1->str_data; } if (len2 > sizeof(buffer2)) { - buf2 = new(*tdbb->tdbb_default, len2) str(); + buf2 = FB_NEW_RPT(*tdbb->tdbb_default, len2) str(); pp2 = (USHORT *) buf2->str_data; } @@ -1977,11 +1977,11 @@ USHORT DLL_EXPORT EVL_mb_matches(TDBB tdbb, len1 = obj->to_wc(NULL, 0, p1, l1, &err_code, &err_pos); len2 = obj->to_wc(NULL, 0, p2, l2, &err_code, &err_pos); if (len1 > sizeof(buffer1)) { - buf1 = new(*tdbb->tdbb_default, len1) str(); + buf1 = FB_NEW_RPT(*tdbb->tdbb_default, len1) str(); pp1 = (USHORT *) buf1->str_data; } if (len2 > sizeof(buffer2)) { - buf2 = new(*tdbb->tdbb_default, len2) str(); + buf2 = FB_NEW_RPT(*tdbb->tdbb_default, len2) str(); pp2 = (USHORT *) buf2->str_data; } @@ -2037,7 +2037,7 @@ USHORT DLL_EXPORT EVL_mb_sleuth_check(TDBB tdbb, len1 = obj->to_wc(NULL, 0, search, search_bytes, &err_code, &err_pos); if (len1 > sizeof(buffer1)) { - buf1 = new(*tdbb->tdbb_default, len1) str(); + buf1 = FB_NEW_RPT(*tdbb->tdbb_default, len1) str(); pp1 = (USHORT *) buf1->str_data; } @@ -2091,11 +2091,11 @@ USHORT DLL_EXPORT EVL_mb_sleuth_merge(TDBB tdbb, len1 = obj->to_wc(NULL, 0, match, match_bytes, &err_code, &err_pos); len2 = obj->to_wc(NULL, 0, control, control_bytes, &err_code, &err_pos); if (len1 > sizeof(buffer1)) { - buf1 = new(*tdbb->tdbb_default, len1) str(); + buf1 = FB_NEW_RPT(*tdbb->tdbb_default, len1) str(); pp1 = (USHORT *) buf1->str_data; } if (len2 > sizeof(buffer2)) { - buf2 = new(*tdbb->tdbb_default, len2) str(); + buf2 = FB_NEW_RPT(*tdbb->tdbb_default, len2) str(); pp2 = (USHORT *) buf2->str_data; } @@ -3088,7 +3088,7 @@ static DSC *cast(TDBB tdbb, DSC * value, NOD node, VLU impure) } if (!string) { - string = impure->vlu_string = new(*tdbb->tdbb_default, length) str(); + string = impure->vlu_string = FB_NEW_RPT(*tdbb->tdbb_default, length) str(); string->str_length = length; } @@ -4524,7 +4524,7 @@ static SSHORT sleuth(TDBB tdbb, NOD node, DSC * desc1, DSC * desc2) #ifdef STACK_REDUCTION /* do a block allocate */ - temp_str = new(*tdbb->tdbb_default, ((SLONG) + temp_str = FB_NEW_RPT(*tdbb->tdbb_default, ((SLONG) (sizeof(UCHAR) * (2 * TEMP_LENGTH + BUFFER_LARGE + BUFFER_SMALL)))) str(); @@ -4650,7 +4650,7 @@ static SSHORT string_boolean(TDBB tdbb, NOD node, DSC * desc1, DSC * desc2) #ifdef STACK_REDUCTION /* do a block allocation of local variables */ temp_str = - new(*tdbb->tdbb_default, + FB_NEW_RPT(*tdbb->tdbb_default, (SLONG) (sizeof(UCHAR) * (2 * TEMP_LENGTH + BUFFER_LARGE))) str(); temp1 = temp_str->str_data; @@ -4794,7 +4794,7 @@ static SSHORT string_function( UCHAR *temp3; SET_TDBB(tdbb); - temp_str = new(*tdbb->tdbb_default, (sizeof(UCHAR) * TEMP_LENGTH)) str(); + temp_str = FB_NEW_RPT(*tdbb->tdbb_default, (sizeof(UCHAR) * TEMP_LENGTH)) str(); temp3 = temp_str->str_data; #endif @@ -4871,7 +4871,7 @@ static DSC *substring( else { USHORT bufflen = MAX(BUFFER_LARGE, length); - STR temp_str = new(*tdbb->tdbb_default, sizeof(UCHAR) * bufflen) str(); + STR temp_str = FB_NEW_RPT(*tdbb->tdbb_default, sizeof(UCHAR) * bufflen) str(); UCHAR *buffer = temp_str->str_data; USHORT datalen = 0; diff --git a/src/jrd/exe.cpp b/src/jrd/exe.cpp index 19e0d1eb17..7dd7a92c3e 100644 --- a/src/jrd/exe.cpp +++ b/src/jrd/exe.cpp @@ -31,7 +31,7 @@ * to count virtual operations, not real I/O on the underlying tables. */ /* -$Id: exe.cpp,v 1.17 2002-09-19 16:02:57 skidder Exp $ +$Id: exe.cpp,v 1.18 2002-09-25 17:12:09 skidder Exp $ */ #include "firebird.h" @@ -1334,7 +1334,7 @@ static void exec_sql(TDBB tdbb, REQ request, DSC* dsc) UCHAR *p; vary *v = reinterpret_cast ( - new(*tdbb->tdbb_transaction->tra_pool) char[BUFFER_LARGE + sizeof(vary)]); + FB_NEW(*tdbb->tdbb_transaction->tra_pool) char[BUFFER_LARGE + sizeof(vary)]); v->vary_length = BUFFER_LARGE; SSHORT l; STATUS *status, local[ISC_STATUS_LENGTH]; @@ -1434,7 +1434,7 @@ static void execute_procedure(TDBB tdbb, NOD node) format = (FMT) procedure->prc_output_msg->nod_arg[e_msg_format]; out_msg_length = format->fmt_length; temp_buffer = - new(*tdbb->tdbb_default, out_msg_length + DOUBLE_ALIGN - 1) str(); + FB_NEW_RPT(*tdbb->tdbb_default, out_msg_length + DOUBLE_ALIGN - 1) str(); out_msg = (SCHAR *) FB_ALIGN((U_IPTR) temp_buffer->str_data, DOUBLE_ALIGN); } @@ -1855,7 +1855,7 @@ static NOD looper(TDBB tdbb, REQ request, NOD in_node) if (variable->vlu_desc.dsc_dtype <= dtype_varying && !variable->vlu_string) { variable->vlu_string = - new(*tdbb->tdbb_default, + FB_NEW_RPT(*tdbb->tdbb_default, variable->vlu_desc.dsc_length) str(); variable->vlu_string->str_length = variable->vlu_desc.dsc_length; diff --git a/src/jrd/exe.h b/src/jrd/exe.h index 54d571843c..28e6dbd3db 100644 --- a/src/jrd/exe.h +++ b/src/jrd/exe.h @@ -559,7 +559,7 @@ public: {} static Csb* newCsb(MemoryPool& p, size_t len) - { return new(p) Csb(p, len); } + { return FB_NEW(p) Csb(p, len); } UCHAR* csb_blr; UCHAR* csb_running; diff --git a/src/jrd/ext.cpp b/src/jrd/ext.cpp index c533b21050..005c2b4ed5 100644 --- a/src/jrd/ext.cpp +++ b/src/jrd/ext.cpp @@ -172,7 +172,7 @@ EXT EXT_file(REL relation, TEXT * file_name, SLONG * description) if (!_access(ib_file_path, 4)) { relation->rel_file = file = - new(*dbb->dbb_permanent, strlen(ib_file_path) + 1) ext(); + FB_NEW_RPT(*dbb->dbb_permanent, strlen(ib_file_path) + 1) ext(); strcpy(reinterpret_cast(file->ext_filename), absolute_file); found_dir = TRUE; } @@ -182,12 +182,12 @@ EXT EXT_file(REL relation, TEXT * file_name, SLONG * description) if (!found_dir) { relation->rel_file = file = - new(*dbb->dbb_permanent, strlen(file_name) + 1) ext(); + FB_NEW_RPT(*dbb->dbb_permanent, strlen(file_name) + 1) ext(); strcpy(reinterpret_cast(file->ext_filename), file_name); } #else relation->rel_file = file = - new(*dbb->dbb_permanent, (strlen(file_name) + 1)) ext(); + FB_NEW_RPT(*dbb->dbb_permanent, (strlen(file_name) + 1)) ext(); strcpy(reinterpret_cast(file->ext_filename), file_name); #endif @@ -476,7 +476,7 @@ if (opt->opt_count) */ - rsb_ = new(*tdbb->tdbb_default,0) Rsb; + rsb_ = FB_NEW_RPT(*tdbb->tdbb_default,0) Rsb; rsb_->rsb_type = rsb_ext_sequential; size = sizeof(struct irsb); diff --git a/src/jrd/extvms.cpp b/src/jrd/extvms.cpp index a8ccbbe84e..4174c9134a 100644 --- a/src/jrd/extvms.cpp +++ b/src/jrd/extvms.cpp @@ -169,7 +169,7 @@ EXT EXT_file(REL relation, TEXT * file_name, SLONG * description) format. */ l = strlen(file_name); - relation->rel_file = file = new(dbb->dbb_permanent, l) ext(); + relation->rel_file = file = FB_NEW_RPT(dbb->dbb_permanent, l) ext(); strcpy(file->ext_filename, file_name); format = file->ext_format = MET_format(tdbb, relation, 0); expand_format(format, MET_current(tdbb, relation)); @@ -243,7 +243,7 @@ EXT EXT_file(REL relation, TEXT * file_name, SLONG * description) index = (IDX *) (index->idx_rpt + index->idx_count); } if (l = (UCHAR *) index - index_buffer) { - string = new(tdbb->tdbb_default, l) str(); + string = FB_NEW_RPT(tdbb->tdbb_default, l) str(); MOVE_FAST(index_buffer, string->str_data, l); file->ext_indices = string->str_data; } @@ -486,21 +486,21 @@ RSB EXT_optimize(register OPT opt, SSHORT stream, NOD * sort_ptr) block */ if (dbkey) { - rsb = new(tdbb->tdbb_default, 1) rsb(); + rsb = FB_NEW_RPT(tdbb->tdbb_default, 1) rsb(); rsb->rsb_type = rsb_ext_dbkey; rsb->rsb_count = 1; size = sizeof(struct irsb_index); rsb->rsb_arg[0] = (RSB) dbkey; } else if (inversion) { - rsb = new(tdbb->tdbb_default, 1) rsb(); + rsb = FB_NEW_RPT(tdbb->tdbb_default, 1) rsb(); rsb->rsb_type = rsb_ext_indexed; rsb->rsb_count = 1; size = sizeof(struct irsb_index); rsb->rsb_arg[0] = (RSB) inversion; } else { - rsb = new(tdbb->tdbb_default) rsb(); + rsb = FB_NEW(tdbb->tdbb_default) rsb(); rsb->rsb_type = rsb_ext_sequential; size = sizeof(struct irsb); } diff --git a/src/jrd/fun.epp b/src/jrd/fun.epp index 98aaf9d71d..fb711040b8 100644 --- a/src/jrd/fun.epp +++ b/src/jrd/fun.epp @@ -24,7 +24,7 @@ * to signal NULL by testing the flags of the parameter's descriptor. */ /* -$Id: fun.epp,v 1.8 2002-09-06 13:05:33 alexpeshkoff Exp $ +$Id: fun.epp,v 1.9 2002-09-25 17:12:09 skidder Exp $ */ #include "firebird.h" @@ -120,7 +120,7 @@ void DLL_EXPORT FUN_evaluate(FUN function, NOD node, VLU value) a number of data blocks with aligned length */ temp_string = - new(*tdbb->tdbb_default, + FB_NEW_RPT(*tdbb->tdbb_default, function->fun_temp_length + DOUBLE_ALIGN - 1) str; MOVE_CLEAR(temp_string->str_data, temp_string->str_length); temp_ptr = @@ -161,7 +161,7 @@ void DLL_EXPORT FUN_evaluate(FUN function, NOD node, VLU value) string = NULL; } if (!string) { - string = new(*tdbb->tdbb_default, length) str; + string = FB_NEW_RPT(*tdbb->tdbb_default, length) str; string->str_length = length; value->vlu_string = string; } @@ -720,7 +720,7 @@ FUN DLL_EXPORT FUN_lookup_function(TEXT * name) l = sizeof(struct blob); length += l; END_FOR; - function = new(*dbb->dbb_permanent, count + 1) fun; + function = FB_NEW_RPT(*dbb->dbb_permanent, count + 1) fun; function->fun_count = count; function->fun_args = args; function->fun_return_arg = X.RDB$RETURN_ARGUMENT; @@ -739,7 +739,7 @@ FUN DLL_EXPORT FUN_lookup_function(TEXT * name) causes an exception. This is done at this time to save us from preparing (thus allocating) this message every time the function is called. */ exception_msg = - new(*dbb->dbb_permanent, + FB_NEW_RPT(*dbb->dbb_permanent, strlen(EXCEPTION_MESSAGE) + strlen(name) + strlen(X.RDB$ENTRYPOINT) + strlen(X.RDB$MODULE_NAME) + 1) str; @@ -792,9 +792,9 @@ FUN DLL_EXPORT FUN_lookup_function(TEXT * name) else { prior = function; - function->fun_symbol = symbol = new(*dbb->dbb_permanent) sym; + function->fun_symbol = symbol = FB_NEW(*dbb->dbb_permanent) sym; symbol->sym_object = (BLK) function; - string = new(*dbb->dbb_permanent, strlen(name)) str; + string = FB_NEW_RPT(*dbb->dbb_permanent, strlen(name)) str; strcpy((char*)string->str_data, name); symbol->sym_string = (TEXT *) string->str_data; symbol->sym_type = SYM_fun; diff --git a/src/jrd/grant.epp b/src/jrd/grant.epp index 4cbc8640ec..c28d474148 100644 --- a/src/jrd/grant.epp +++ b/src/jrd/grant.epp @@ -175,8 +175,8 @@ int GRANT_privileges( TDBB tdbb, SSHORT phase, DFW work) try { - str_buffer = new(*dbb->dbb_permanent, ACL_BUFFER_SIZE) str; - str_default_buffer = new(*dbb->dbb_permanent, ACL_BUFFER_SIZE) str; + str_buffer = FB_NEW_RPT(*dbb->dbb_permanent, ACL_BUFFER_SIZE) str; + str_default_buffer = FB_NEW_RPT(*dbb->dbb_permanent, ACL_BUFFER_SIZE) str; acl = str_buffer->str_data; @@ -798,8 +798,8 @@ TEXT * relation_name, TEXT * owner, USHORT public_priv, ULONG * length_ptr) /* initialize the field-level acl buffer to include all relation-level privs */ - str_field_buffer_start = new(*dbb->dbb_permanent, *length_ptr) str; - str_field_buffer = new(*dbb->dbb_permanent, *length_ptr) str; + str_field_buffer_start = FB_NEW_RPT(*dbb->dbb_permanent, *length_ptr) str; + str_field_buffer = FB_NEW_RPT(*dbb->dbb_permanent, *length_ptr) str; field_length = start_length = *length_ptr; diff --git a/src/jrd/idx.cpp b/src/jrd/idx.cpp index 6cff8fdae1..a8de50cdac 100644 --- a/src/jrd/idx.cpp +++ b/src/jrd/idx.cpp @@ -478,7 +478,7 @@ IDB IDX_create_index_block(TDBB tdbb, REL relation, UCHAR id) dbb = tdbb->tdbb_database; CHECK_DBB(dbb); - index_block = new(*dbb->dbb_permanent) idb(); + index_block = FB_NEW(*dbb->dbb_permanent) idb(); index_block->idb_id = id; /* link the block in with the relation linked list */ @@ -490,7 +490,7 @@ IDB IDX_create_index_block(TDBB tdbb, REL relation, UCHAR id) any modification to the index so that the cached information about the index will be discarded */ - index_block->idb_lock = lock = new(*dbb->dbb_permanent, 0) lck; + index_block->idb_lock = lock = FB_NEW_RPT(*dbb->dbb_permanent, 0) lck; lock->lck_parent = dbb->dbb_lock; lock->lck_dbb = dbb; lock->lck_key.lck_long = index_block->idb_id; diff --git a/src/jrd/ini.epp b/src/jrd/ini.epp index f35919b13d..4b6b8ae688 100644 --- a/src/jrd/ini.epp +++ b/src/jrd/ini.epp @@ -543,7 +543,7 @@ void INI_init(void) gfield = &gfields[fld_[RFLD_F_ID]]; desc->dsc_length = gfield->gfld_length; desc->dsc_dtype = gfield->gfld_dtype; - *itr = field = new(*dbb->dbb_permanent,0) fld(); + *itr = field = FB_NEW_RPT(*dbb->dbb_permanent,0) fld(); field->fld_name = names[fld_[RFLD_F_NAME]]; field->fld_length = strlen(field->fld_name); } diff --git a/src/jrd/intl.cpp b/src/jrd/intl.cpp index 5f481830de..9b6596edc9 100644 --- a/src/jrd/intl.cpp +++ b/src/jrd/intl.cpp @@ -500,7 +500,7 @@ CHARSET_ID src_type, BYTE * src_ptr, USHORT src_len, FPTR_VOID err) /* ** allocate a temporary buffer that is large enough. 2 = sizeof WCHAR */ - tmp_buffer = (BYTE *) new(*getDefaultMemoryPool()) char[(SLONG) src_len * 2]; + tmp_buffer = (BYTE *) FB_NEW(*getDefaultMemoryPool()) char[(SLONG) src_len * 2]; cs_obj = from_cs->getConvToUnicode(); assert(cs_obj != NULL); @@ -1015,7 +1015,7 @@ static CharSetContainer *internal_charset_container_lookup(TDBB tdbb, SSHORT par if (!newCs) return NULL; - cs = new(*dbb->dbb_permanent) CharSetContainer(*dbb->dbb_permanent, newCs); + cs = FB_NEW(*dbb->dbb_permanent) CharSetContainer(*dbb->dbb_permanent, newCs); if (!cs) { delete newCs; @@ -1942,8 +1942,8 @@ public: (char*)csStruct->charset_space_character), cs(csStruct) { - charset_to_unicode = new(p) CsConvert_BC(&cs->charset_to_unicode, false); - charset_from_unicode = new(p) CsConvert_BC(&cs->charset_from_unicode, false); + charset_to_unicode = FB_NEW(p) CsConvert_BC(&cs->charset_to_unicode, false); + charset_from_unicode = FB_NEW(p) CsConvert_BC(&cs->charset_from_unicode, false); } ~CharSet_BC() { delete cs; } @@ -2293,7 +2293,7 @@ static CharSet *BC_CharSetAllocFunc(MemoryPool &p, SSHORT cs_id, SSHORT unused) csInitFunc = (CSInitFunc) intl_back_compat_obj_init_lookup(type_charset, cs_id, unused); assert(csInitFunc != 0); - CHARSET cs = new(p) charset; + CHARSET cs = FB_NEW(p) charset; memset(cs, 0, sizeof(charset)); if (0 != (*csInitFunc)(cs, cs_id, unused)) @@ -2305,7 +2305,7 @@ static CharSet *BC_CharSetAllocFunc(MemoryPool &p, SSHORT cs_id, SSHORT unused) CharSet *result = 0; try { - result = new(p) CharSet_BC(p, cs); + result = FB_NEW(p) CharSet_BC(p, cs); } catch(std::exception&) { @@ -2324,7 +2324,7 @@ static CsConvert *BC_CsConvertAllocFunc(MemoryPool &p, SSHORT from_id, SSHORT to //cvtInitFunc = (CVTInitFunc) intl_back_compat_obj_init_lookup(type_csconvert, from_id, to_id); cvtInitFunc = (CVTInitFunc) intl_back_compat_obj_init_lookup(type_csconvert, to_id, from_id); assert(cvtInitFunc != 0); - CSCONVERT cvt = new(p) csconvert; + CSCONVERT cvt = FB_NEW(p) csconvert; memset(cvt, 0, sizeof(csconvert)); //if (0 != (*cvtInitFunc)(cvt, from_id, to_id)) @@ -2337,7 +2337,7 @@ static CsConvert *BC_CsConvertAllocFunc(MemoryPool &p, SSHORT from_id, SSHORT to CsConvert *result = 0; try { - result = new(p) CsConvert_BC(cvt, true); + result = FB_NEW(p) CsConvert_BC(cvt, true); } catch(std::exception&) { @@ -2355,7 +2355,7 @@ static TextType *BC_TextTypeAllocFunc(MemoryPool &p, SSHORT tt_id, SSHORT unused ttInitFunc = (TTInitFunc) intl_back_compat_obj_init_lookup(type_texttype, tt_id, unused); assert(ttInitFunc != 0); - TEXTTYPE tt = new(p) texttype; + TEXTTYPE tt = FB_NEW(p) texttype; memset(tt, 0, sizeof(texttype)); if (0 != (*ttInitFunc)(tt, tt_id, unused)) @@ -2368,11 +2368,11 @@ static TextType *BC_TextTypeAllocFunc(MemoryPool &p, SSHORT tt_id, SSHORT unused try { if (tt->texttype_bytes_per_char == 1 && tt->texttype_fn_to_wc == NULL) - result = new(p) TextType_BC(tt); + result = FB_NEW(p) TextType_BC(tt); else if (tt->texttype_bytes_per_char == 2 && tt->texttype_fn_to_wc == NULL) - result = new(p) TextType_BC(tt); + result = FB_NEW(p) TextType_BC(tt); else if (tt->texttype_fn_to_wc != NULL) - result = new(p) TextType_BC(tt); + result = FB_NEW(p) TextType_BC(tt); else BUGCHECK(1); } diff --git a/src/jrd/intl_builtin.cpp b/src/jrd/intl_builtin.cpp index ba1f39388a..2bbb09be64 100644 --- a/src/jrd/intl_builtin.cpp +++ b/src/jrd/intl_builtin.cpp @@ -47,7 +47,7 @@ class TextType_Binary : public TextTypeNC { public: static TextType *object_factory(MemoryPool &p, CHARSET_ID u1, CHARSET_ID u2) - { return new(p) TextType_Binary; } + { return FB_NEW(p) TextType_Binary; } TextType_Binary() : TextTypeNC(ttype_binary, "C.OCTETS", CS_BINARY, CC_C, 1) {} @@ -82,7 +82,7 @@ class TextType_UFSS : public TextTypeMB { public: static TextType *object_factory(MemoryPool &p, CHARSET_ID u1, CHARSET_ID u2) - { return new(p) TextType_UFSS; } + { return FB_NEW(p) TextType_UFSS; } TextType_UFSS() : TextTypeMB(ttype_unicode_fss, "C.UNICODE_FSS", CS_UNICODE_FSS, CC_C, 3) {} @@ -129,7 +129,7 @@ class TextType_ASCII : public TextTypeNC { public: static TextType *object_factory(MemoryPool &p, CHARSET_ID u1, CHARSET_ID u2) - { return new(p) TextType_ASCII; } + { return FB_NEW(p) TextType_ASCII; } TextType_ASCII() : TextTypeNC(ttype_ascii, "C.ASCII", CS_ASCII, CC_C, 1) {} @@ -165,7 +165,7 @@ class TextType_None : public TextTypeNC { public: static TextType *object_factory(MemoryPool &p, CHARSET_ID u1, CHARSET_ID u2) - { return new(p) TextType_None; } + { return FB_NEW(p) TextType_None; } TextType_None() : TextTypeNC(ttype_none, "C", CS_NONE, CC_C, 1) {} @@ -201,7 +201,7 @@ class CsConvert_ASCII_UFSS : public CsConvert { public: static CsConvert *object_factory(MemoryPool& p, CHARSET_ID u1, CHARSET_ID u2) - { return new(p) CsConvert_ASCII_UFSS; } + { return FB_NEW(p) CsConvert_ASCII_UFSS; } CsConvert_ASCII_UFSS() : CsConvert(0, "DIRECT", CS_ASCII, CS_UNICODE_FSS) {} @@ -218,7 +218,7 @@ class CsConvert_UFSS_ASCII : public CsConvert { public: static CsConvert *object_factory(MemoryPool& p, CHARSET_ID u1, CHARSET_ID u2) - { return new(p) CsConvert_UFSS_ASCII; } + { return FB_NEW(p) CsConvert_UFSS_ASCII; } CsConvert_UFSS_ASCII() : CsConvert(0, "DIRECT", CS_UNICODE_FSS, CS_ASCII) {} unsigned short convert(unsigned char *a, @@ -234,7 +234,7 @@ class CsConvert_UFSS_None : public CsConvert { public: static CsConvert *object_factory(MemoryPool& p, CHARSET_ID u1, CHARSET_ID u2) - { return new(p) CsConvert_UFSS_None; } + { return FB_NEW(p) CsConvert_UFSS_None; } CsConvert_UFSS_None() : CsConvert(0, "DIRECT", CS_UNICODE_FSS, CS_NONE) {} unsigned short convert(unsigned char *a, @@ -250,7 +250,7 @@ class CsConvert_None_Unicode : public CsConvert { public: static CsConvert *object_factory(MemoryPool& p, CHARSET_ID u1, CHARSET_ID u2) - { return new(p) CsConvert_None_Unicode; } + { return FB_NEW(p) CsConvert_None_Unicode; } CsConvert_None_Unicode() : CsConvert(0, "DIRECT", CS_NONE, CS_UNICODE101) {} unsigned short convert(unsigned char*, @@ -265,7 +265,7 @@ class CsConvert_Unicode_None : public CsConvert { public: static CsConvert *object_factory(MemoryPool& p, CHARSET_ID u1, CHARSET_ID u2) - { return new(p) CsConvert_Unicode_None; } + { return FB_NEW(p) CsConvert_Unicode_None; } CsConvert_Unicode_None() : CsConvert(0, "DIRECT", CS_UNICODE101, CS_NONE) {} unsigned short convert(unsigned char*, @@ -280,7 +280,7 @@ class CsConvert_ASCII_Unicode : public CsConvert { public: static CsConvert *object_factory(MemoryPool& p, CHARSET_ID u1, CHARSET_ID u2) - { return new(p) CsConvert_ASCII_Unicode; } + { return FB_NEW(p) CsConvert_ASCII_Unicode; } CsConvert_ASCII_Unicode() : CsConvert(0, "DIRECT", CS_ASCII, CS_UNICODE101) {} unsigned short convert(unsigned char*, @@ -295,7 +295,7 @@ class CsConvert_Unicode_ASCII : public CsConvert { public: static CsConvert *object_factory(MemoryPool& p, CHARSET_ID u1, CHARSET_ID u2) - { return new(p) CsConvert_Unicode_ASCII; } + { return FB_NEW(p) CsConvert_Unicode_ASCII; } CsConvert_Unicode_ASCII() : CsConvert(0, "DIRECT", CS_UNICODE101, CS_ASCII) {} unsigned short convert(unsigned char*, @@ -310,7 +310,7 @@ class CsConvert_UFSS_Unicode : public CsConvert { public: static CsConvert *object_factory(MemoryPool& p, CHARSET_ID u1, CHARSET_ID u2) - { return new(p) CsConvert_UFSS_Unicode; } + { return FB_NEW(p) CsConvert_UFSS_Unicode; } CsConvert_UFSS_Unicode() : CsConvert(0, "DIRECT", CS_UNICODE_FSS, CS_UNICODE101) {} unsigned short convert(unsigned char*, @@ -325,7 +325,7 @@ class CsConvert_Unicode_UFSS : public CsConvert { public: static CsConvert *object_factory(MemoryPool& p, CHARSET_ID u1, CHARSET_ID u2) - { return new(p) CsConvert_Unicode_UFSS; } + { return FB_NEW(p) CsConvert_Unicode_UFSS; } CsConvert_Unicode_UFSS() : CsConvert(0, "DIRECT", CS_UNICODE101, CS_UNICODE_FSS) {} unsigned short convert(unsigned char *a, @@ -341,7 +341,7 @@ class CsConvert_Binary_Unicode : public CsConvert { public: static CsConvert *object_factory(MemoryPool& p, CHARSET_ID u1, CHARSET_ID u2) - { return new(p) CsConvert_Binary_Unicode; } + { return FB_NEW(p) CsConvert_Binary_Unicode; } CsConvert_Binary_Unicode() : CsConvert(0, "DIRECT", CS_BINARY, CS_UNICODE101) {} unsigned short convert(unsigned char*, @@ -356,7 +356,7 @@ class CsConvert_Unicode_Binary : public CsConvert { public: static CsConvert *object_factory(MemoryPool& p, CHARSET_ID u1, CHARSET_ID u2) - { return new(p) CsConvert_Unicode_Binary; } + { return FB_NEW(p) CsConvert_Unicode_Binary; } CsConvert_Unicode_Binary() : CsConvert(0, "DIRECT", CS_UNICODE101, CS_BINARY) {} unsigned short convert(unsigned char*, @@ -371,7 +371,7 @@ class CharSet_None : public CharSet { public: static CharSet *object_factory(MemoryPool &p, CHARSET_ID u1, CHARSET_ID u2) - { return new(p) CharSet_None(p); } + { return FB_NEW(p) CharSet_None(p); } CharSet_None(MemoryPool &p) : CharSet(CS_NONE, "NONE", 1, 1, 1, " ") { charset_to_unicode = CsConvert_None_Unicode::object_factory(p,0,0); @@ -383,7 +383,7 @@ class CharSet_ASCII : public CharSet { public: static CharSet *object_factory(MemoryPool &p, CHARSET_ID u1, CHARSET_ID u2) - { return new(p) CharSet_ASCII(p); } + { return FB_NEW(p) CharSet_ASCII(p); } CharSet_ASCII(MemoryPool &p) : CharSet(CS_ASCII, "ASCII", 1, 1, 1, " ") { charset_to_unicode = CsConvert_ASCII_Unicode::object_factory(p,0,0); @@ -395,7 +395,7 @@ class CharSet_Unicode_FSS : public CharSet { public: static CharSet *object_factory(MemoryPool &p, CHARSET_ID u1, CHARSET_ID u2) - { return new(p) CharSet_Unicode_FSS(p); } + { return FB_NEW(p) CharSet_Unicode_FSS(p); } CharSet_Unicode_FSS(MemoryPool &p) : CharSet(CS_UNICODE_FSS, "UNICODE_FSS", 1, 1, 1, " ") { charset_to_unicode = CsConvert_UFSS_Unicode::object_factory(p,0,0); @@ -407,7 +407,7 @@ class CharSet_Unicode : public CharSet { public: static CharSet *object_factory(MemoryPool &p, CHARSET_ID u1, CHARSET_ID u2) - { return new(p) CharSet_Unicode(p); } + { return FB_NEW(p) CharSet_Unicode(p); } CharSet_Unicode(MemoryPool &p) : CharSet(CS_UNICODE101, "UNICODE101", 2, 2, 2, 0) { static CONST WCHAR space = 0x0020; @@ -419,7 +419,7 @@ class CharSet_Binary : public CharSet { public: static CharSet *object_factory(MemoryPool &p, CHARSET_ID u1, CHARSET_ID u2) - { return new(p) CharSet_Binary(p); } + { return FB_NEW(p) CharSet_Binary(p); } CharSet_Binary(MemoryPool &p) : CharSet(CS_BINARY, "BINARY", 1, 1, 1, "\0") { charset_to_unicode = CsConvert_Binary_Unicode::object_factory(p,0,0); diff --git a/src/jrd/jrd.cpp b/src/jrd/jrd.cpp index c77e30c24d..1d1f7540b9 100644 --- a/src/jrd/jrd.cpp +++ b/src/jrd/jrd.cpp @@ -232,7 +232,7 @@ void trig::compile(tdbb* _tdbb) { compile_in_progress = TRUE; old_pool = _tdbb->tdbb_default; - _tdbb->tdbb_default = new(*getDefaultMemoryPool()) JrdMemoryPool; + _tdbb->tdbb_default = FB_NEW(*getDefaultMemoryPool()) JrdMemoryPool; // Trigger request is not compiled yet. Lets do it now PAR_blr(_tdbb, relation, blr->str_data, (CSB)NULL_PTR, (CSB*)NULL_PTR, &request, TRUE, @@ -746,7 +746,7 @@ STATUS DLL_EXPORT GDS_ATTACH_DATABASE(STATUS* user_status, } #endif - tdbb->tdbb_attachment = attachment = new(*dbb->dbb_permanent) att(); + tdbb->tdbb_attachment = attachment = FB_NEW(*dbb->dbb_permanent) att(); attachment->att_database = dbb; attachment->att_filename = (is_alias) ? copy_string(alias_buffer, strlen(alias_buffer)) : @@ -1872,7 +1872,7 @@ STATUS DLL_EXPORT GDS_CREATE_DATABASE(STATUS* user_status, copy_string(options.dpb_key, strlen(options.dpb_key)); #endif - tdbb->tdbb_attachment = attachment = new(*dbb->dbb_permanent) att(); + tdbb->tdbb_attachment = attachment = FB_NEW(*dbb->dbb_permanent) att(); attachment->att_database = dbb; attachment->att_filename = copy_string(expanded_name, strlen(expanded_name)); attachment->att_next = dbb->dbb_attachments; @@ -3830,7 +3830,7 @@ STATUS DLL_EXPORT GDS_TRANSACT_REQUEST(STATUS* user_status, transaction = find_transaction(tdbb, *tra_handle, gds_req_wrong_db); old_pool = tdbb->tdbb_default; - tdbb->tdbb_default = new_pool = new(*tdbb->tdbb_database->dbb_permanent) + tdbb->tdbb_default = new_pool = FB_NEW(*tdbb->tdbb_database->dbb_permanent) JrdMemoryPool; csb = PAR_parse(tdbb, reinterpret_cast < UCHAR * >(blr), FALSE); @@ -4125,7 +4125,7 @@ void JRD_blocked(ATT blocking, BTB * que) if (block) { dbb->dbb_free_btbs = block->btb_next; } else { - block = new(*dbb->dbb_permanent) btb; + block = FB_NEW(*dbb->dbb_permanent) btb; } block->btb_thread_id = (SLONG) SCH_current_thread(); @@ -4838,7 +4838,7 @@ static STR copy_string(TEXT * ptr, USHORT length) * **************************************/ DBB dbb = get_dbb(); - STR string = new(*dbb->dbb_permanent, length) str(); + STR string = FB_NEW_RPT(*dbb->dbb_permanent, length) str(); string->str_length = length; MOVE_FAST(ptr, string->str_data, length); @@ -5608,7 +5608,7 @@ static DBB init(TDBB tdbb, try { - JrdMemoryPool* perm = new(*getDefaultMemoryPool()) JrdMemoryPool; + JrdMemoryPool* perm = FB_NEW(*getDefaultMemoryPool()) JrdMemoryPool; dbb_ = dbb::newDbb(*perm); //temp.blk_type = type_dbb; dbb_->dbb_permanent = perm; @@ -5625,12 +5625,12 @@ static DBB init(TDBB tdbb, databases = dbb_; string = - new(*dbb_->dbb_permanent, THREAD_STRUCT_SIZE(MUTX_T, DBB_MUTX_max)) str(); + FB_NEW_RPT(*dbb_->dbb_permanent, THREAD_STRUCT_SIZE(MUTX_T, DBB_MUTX_max)) str(); dbb_->dbb_mutexes = (MUTX) THREAD_STRUCT_ALIGN(string->str_data); THD_MUTEX_INIT_N(dbb_->dbb_mutexes, DBB_MUTX_max); string = - new(*dbb_->dbb_permanent, THREAD_STRUCT_SIZE(WLCK_T, DBB_WLCK_max)) str(); + FB_NEW_RPT(*dbb_->dbb_permanent, THREAD_STRUCT_SIZE(WLCK_T, DBB_WLCK_max)) str(); dbb_->dbb_rw_locks = (WLCK) THREAD_STRUCT_ALIGN(string->str_data); V4_RW_LOCK_INIT_N(dbb_->dbb_rw_locks, DBB_WLCK_max); dbb_->dbb_internal = vector = vec::newVector(*dbb_->dbb_permanent, irq_MAX); diff --git a/src/jrd/jrd.h b/src/jrd/jrd.h index bc56a57698..1eef1c1562 100644 --- a/src/jrd/jrd.h +++ b/src/jrd/jrd.h @@ -110,7 +110,7 @@ class tdbb; class dbb : private pool_alloc { public: - static dbb* newDbb(MemoryPool& p) { return new(p) dbb(p); } + static dbb* newDbb(MemoryPool& p) { return FB_NEW(p) dbb(p); } // The deleteDbb function MUST be used to delete a dbb object. // The function hides some tricky order of operations. Since the @@ -689,9 +689,9 @@ public: typedef typename Firebird::vector::iterator iterator; static vec_base* newVector(MemoryPool& p, int len) - { return new(p) vec_base(p, len); } + { return FB_NEW(p) vec_base(p, len); } static vec_base* newVector(MemoryPool& p, const vec_base& base) - { return new(p) vec_base(p, base); } + { return FB_NEW(p) vec_base(p, base); } ULONG count() { return vector.size(); } T& operator[](size_t index) { return vector[index]; } @@ -723,9 +723,9 @@ class vec : public vec_base { public: static vec* newVector(MemoryPool& p, int len) - { return new(p) vec(p, len); } + { return FB_NEW(p) vec(p, len); } static vec* newVector(MemoryPool& p, const vec& base) - { return new(p) vec(p, base); } + { return FB_NEW(p) vec(p, base); } private: vec(MemoryPool& p, int len) : vec_base(p, len) {} @@ -737,9 +737,9 @@ class vcl : public vec_base { public: static vcl* newVector(MemoryPool& p, int len) - { return new(p) vcl(p, len); } + { return FB_NEW(p) vcl(p, len); } static vcl* newVector(MemoryPool& p, const vcl& base) - { return new(p) vcl(p, base); } + { return FB_NEW(p) vcl(p, base); } private: vcl(MemoryPool& p, int len) : vec_base(p, len) {} @@ -801,7 +801,7 @@ public: return false; // runtime safety } // TMN: Note that this violates "common sense" and should be fixed. - str* res = new(*pPool, new_len+1) str; + str* res = FB_NEW_RPT(*pPool, new_len+1) str; res->str_length = new_len; memcpy(res->str_data, s->str_data, s->str_length+1); str* old = s; diff --git a/src/jrd/log.cpp b/src/jrd/log.cpp index 6ad013309d..2dccac15a1 100644 --- a/src/jrd/log.cpp +++ b/src/jrd/log.cpp @@ -652,9 +652,9 @@ static void open_log(TEXT * file_name, SSHORT file_length, SCHAR * mode) if (!log_file) error("can't open log file"); else { - dbb->dbb_log = log = new(*dbb->dbb_permanent) log(); + dbb->dbb_log = log = FB_NEW(*dbb->dbb_permanent) log(); log->log_file = log_file; - log->log_string = new(*dbb->dbb_permanent, LOG_BUFFER_LENGTH) str(); + log->log_string = FB_NEW_RPT(*dbb->dbb_permanent, LOG_BUFFER_LENGTH) str(); log->log_ptr = log->log_buffer = log->log_string->str_data; } #ifdef STACK_REDUCTION diff --git a/src/jrd/met.epp b/src/jrd/met.epp index cdd47aa104..9e727f5332 100644 --- a/src/jrd/met.epp +++ b/src/jrd/met.epp @@ -35,7 +35,7 @@ * 2002-09-16 Nickolay Samofatov - Deferred trigger compilation changes */ /* -$Id: met.epp,v 1.17 2002-09-24 08:05:54 dimitr Exp $ +$Id: met.epp,v 1.18 2002-09-25 17:12:10 skidder Exp $ */ // This MUST be at the top of the file #ifdef DARWIN @@ -850,7 +850,7 @@ int MET_get_walinfo( FOR(REQUEST_HANDLE handle) LOG IN RDB$LOG_FILES SORTED BY LOG.RDB$FILE_SEQUENCE - logfiles_[num] = new(*dbb->dbb_permanent, + logfiles_[num] = FB_NEW_RPT(*dbb->dbb_permanent, LGFILE_SIZE + MAX_PATH_LENGTH) logfiles(); strcpy(logfiles_[num]->lg_name, LOG.RDB$FILE_NAME); logfiles_[num]->lg_size = LOG.RDB$FILE_LENGTH; @@ -1308,13 +1308,13 @@ BLF MET_lookup_filter(TDBB tdbb, SSHORT from, SSHORT to) ISC_EXT_LIB_PATH_ENV); if (filter) { - blf_ = new(*dbb->dbb_permanent) blf(); + blf_ = FB_NEW(*dbb->dbb_permanent) blf(); blf_->blf_next = NULL; blf_->blf_from = from; blf_->blf_to = to; blf_->blf_filter = filter; exception_msg = - new(*dbb->dbb_permanent, + FB_NEW_RPT(*dbb->dbb_permanent, strlen(EXCEPTION_MESSAGE) + strlen(X.RDB$FUNCTION_NAME) + strlen(X.RDB$ENTRYPOINT) + @@ -2154,7 +2154,7 @@ NOD MET_parse_blob(TDBB tdbb, blob = BLB_open(tdbb, dbb->dbb_sys_trans, (BID)blob_id); length = blob->blb_length + 10; - temp = new(*tdbb->tdbb_default, length) str(); + temp = FB_NEW_RPT(*tdbb->tdbb_default, length) str(); BLB_get_data(tdbb, blob, temp->str_data, length); node = PAR_blr( tdbb, @@ -2266,7 +2266,7 @@ void MET_parse_sys_trigger(TDBB tdbb, REL relation) ((trig_flags & TRG_ignore_perm) ? csb_ignore_perm : 0); old_pool = tdbb->tdbb_default; - tdbb->tdbb_default = new(*getDefaultMemoryPool()) JrdMemoryPool; + tdbb->tdbb_default = FB_NEW(*getDefaultMemoryPool()) JrdMemoryPool; PAR_blr(tdbb, relation, const_cast(blr), @@ -2454,7 +2454,7 @@ PRC MET_procedure(TDBB tdbb, int id, USHORT flags) if (!procedure) { - procedure = new(*dbb->dbb_permanent, 0) prc; + procedure = FB_NEW_RPT(*dbb->dbb_permanent, 0) prc; } try { @@ -2463,7 +2463,7 @@ PRC MET_procedure(TDBB tdbb, int id, USHORT flags) procedure->prc_id = id; (*vector)[id] = (BLK) procedure; - procedure->prc_existence_lock = lock = new(*dbb->dbb_permanent, 0) lck; + procedure->prc_existence_lock = lock = FB_NEW_RPT(*dbb->dbb_permanent, 0) lck; lock->lck_parent = dbb->dbb_lock; lock->lck_dbb = dbb; lock->lck_key.lck_long = procedure->prc_id; @@ -2544,7 +2544,7 @@ PRC MET_procedure(TDBB tdbb, int id, USHORT flags) /* should be error if field already exists */ parameter = - new(*dbb->dbb_permanent, name_length(PA.RDB$PARAMETER_NAME)) prm(); + FB_NEW_RPT(*dbb->dbb_permanent, name_length(PA.RDB$PARAMETER_NAME)) prm(); parameter->prm_number = PA.RDB$PARAMETER_NUMBER; (*vector)[parameter->prm_number] = (BLK) parameter; name_copy(parameter->prm_string, PA.RDB$PARAMETER_NAME); @@ -2586,7 +2586,7 @@ PRC MET_procedure(TDBB tdbb, int id, USHORT flags) } old_pool = tdbb->tdbb_default; - tdbb->tdbb_default = new(*getDefaultMemoryPool()) JrdMemoryPool; + tdbb->tdbb_default = FB_NEW(*getDefaultMemoryPool()) JrdMemoryPool; csb_ = Csb::newCsb(*tdbb->tdbb_default, 5); csb_->csb_rpt.resize(5); // vec always allocates one too many csb_->csb_count = 5; @@ -2686,14 +2686,14 @@ REL MET_relation(TDBB tdbb, USHORT id) else max_sys_rel = (USHORT) USER_DEF_REL_INIT_ID - 1; - relation = new(*dbb->dbb_permanent) rel(); + relation = FB_NEW(*dbb->dbb_permanent) rel(); (*vector)[id] = (BLK) relation; relation->rel_id = id; if (relation->rel_id <= max_sys_rel) return relation; - relation->rel_existence_lock = lock = new(*dbb->dbb_permanent, 0) lck; + relation->rel_existence_lock = lock = FB_NEW_RPT(*dbb->dbb_permanent, 0) lck; lock->lck_parent = dbb->dbb_lock; lock->lck_dbb = dbb; lock->lck_key.lck_long = relation->rel_id; @@ -3179,7 +3179,7 @@ void MET_scan_relation( TDBB tdbb, REL relation) } else { - string = new(*tdbb->tdbb_default, blob->blb_max_segment) str(); + string = FB_NEW_RPT(*tdbb->tdbb_default, blob->blb_max_segment) str(); buffer = string->str_data; } @@ -3219,11 +3219,11 @@ void MET_scan_relation( TDBB tdbb, REL relation) if (!strcmp((char*)p, (char*)field->fld_name)) break; - name = new(*dbb->dbb_permanent, length) str(); + name = FB_NEW_RPT(*dbb->dbb_permanent, length) str(); field->fld_name = (TEXT *) name->str_data; } else { - field = new(*dbb->dbb_permanent, length) fld(); + field = FB_NEW_RPT(*dbb->dbb_permanent, length) fld(); (*vector)[field_id] = (BLK) field; field->fld_name = (TEXT *) field->fld_string; } @@ -3299,7 +3299,7 @@ void MET_scan_relation( TDBB tdbb, REL relation) break; case RSR_dimensions: - field->fld_array = array = new(*dbb->dbb_permanent, n) arr(); + field->fld_array = array = FB_NEW_RPT(*dbb->dbb_permanent, n) arr(); array->arr_desc.ads_dimensions = n; break; @@ -3618,12 +3618,12 @@ static void get_trigger( return; old_pool = tdbb->tdbb_default; - tdbb->tdbb_default = new(*getDefaultMemoryPool()) JrdMemoryPool; + tdbb->tdbb_default = FB_NEW(*getDefaultMemoryPool()) JrdMemoryPool; DBB dbb = tdbb->tdbb_database; BLB blob = BLB_open(tdbb, dbb->dbb_sys_trans, (BID)blob_id); SLONG length = blob->blb_length + 10; - STR blr = new(*tdbb->tdbb_default,length) str(); + STR blr = FB_NEW_RPT(*tdbb->tdbb_default,length) str(); BLB_get_data(tdbb, blob, blr->str_data, length); tdbb->tdbb_default = old_pool; @@ -3723,7 +3723,7 @@ static void lookup_view_contexts( TDBB tdbb, REL view) /* allocate a view context block and link it in to the relation block's linked list */ - view_context = new(*tdbb->tdbb_default) vcx(); + view_context = FB_NEW(*tdbb->tdbb_default) vcx(); *vcx_ptr = view_context; vcx_ptr = &view_context->vcx_next; @@ -3732,7 +3732,7 @@ static void lookup_view_contexts( TDBB tdbb, REL view) /* allocate a string block for the context name */ length = name_length(V.RDB$CONTEXT_NAME); - alias = new(*tdbb->tdbb_default, length + 1) str(); + alias = FB_NEW_RPT(*tdbb->tdbb_default, length + 1) str(); V.RDB$CONTEXT_NAME[length] = 0; strcpy((char*)alias->str_data, V.RDB$CONTEXT_NAME); alias->str_length = length; @@ -3742,7 +3742,7 @@ static void lookup_view_contexts( TDBB tdbb, REL view) /* allocate a string block for the relation name */ length = name_length(V.RDB$RELATION_NAME); - alias = new(*tdbb->tdbb_default, length + 1) str(); + alias = FB_NEW_RPT(*tdbb->tdbb_default, length + 1) str(); V.RDB$RELATION_NAME[length] = 0; strcpy((char*)alias->str_data, V.RDB$RELATION_NAME); alias->str_length = length; @@ -3830,7 +3830,7 @@ static NOD parse_procedure_blr( blob = BLB_open(tdbb, dbb->dbb_sys_trans, (BID)blob_id); length = blob->blb_length + 10; - temp = new(*tdbb->tdbb_default, length) str(); + temp = FB_NEW_RPT(*tdbb->tdbb_default, length) str(); BLB_get_data(tdbb, blob, temp->str_data, length); (*csb_ptr)->csb_blr = temp->str_data; par_messages(tdbb, temp->str_data, (USHORT) blob->blb_length, procedure, @@ -4091,7 +4091,7 @@ static STR save_name(TDBB tdbb, CONST TEXT* name) dbb = tdbb->tdbb_database; l = name_length(name); - string = new(*dbb->dbb_permanent, l) str(); + string = FB_NEW_RPT(*dbb->dbb_permanent, l) str(); string->str_length = l; p = (TEXT *) string->str_data; @@ -4123,7 +4123,7 @@ static void save_trigger_data(TDBB tdbb, TRIG_VEC* ptr, REL relation, REQ reques TRIG_VEC vector = *ptr; if (!vector) { - vector = new(*tdbb->tdbb_database->dbb_permanent) + vector = FB_NEW(*tdbb->tdbb_database->dbb_permanent) trig_vec(n+1, *tdbb->tdbb_database->dbb_permanent); *ptr = vector; } else { diff --git a/src/jrd/netware.cpp b/src/jrd/netware.cpp index 7d9cc77045..56766ce83a 100644 --- a/src/jrd/netware.cpp +++ b/src/jrd/netware.cpp @@ -626,7 +626,7 @@ static FIL dfs_setup_file(dbb, file_name, file_length, desc) ULONG len; /* Allocate file block and copy file name string */ - file = new(*dbb->dbb_permanent, file_length + 1) fil(); + file = FB_NEW_RPT(*dbb->dbb_permanent, file_length + 1) fil(); file->fil_desc = desc; file->fil_length = file_length; file->fil_max_page = -1; @@ -667,7 +667,7 @@ static FIL dfs_setup_file(dbb, file_name, file_length, desc) l = p - lock_string; - dbb->dbb_lock = lock = new(*dbb->dbb_permanent, l) lck(); + dbb->dbb_lock = lock = FB_NEW_RPT(*dbb->dbb_permanent, l) lck(); lock->lck_type = LCK_database; lock->lck_owner_handle = LCK_get_owner_handle(NULL_TDBB, lock->lck_type); lock->lck_object = reinterpret_cast(dbb); diff --git a/src/jrd/opt.cpp b/src/jrd/opt.cpp index 29fec29f71..1810a96799 100644 --- a/src/jrd/opt.cpp +++ b/src/jrd/opt.cpp @@ -27,7 +27,7 @@ * stored procedure doesn't access tables, views or other procedures directly. */ /* -$Id: opt.cpp,v 1.12 2002-09-17 05:58:36 eku Exp $ +$Id: opt.cpp,v 1.13 2002-09-25 17:12:10 skidder Exp $ */ #include "firebird.h" @@ -357,7 +357,7 @@ RSB OPT_compile(TDBB tdbb, #else - opt_ = new(*dbb->dbb_permanent) Opt(); + opt_ = FB_NEW(*dbb->dbb_permanent) Opt(); #endif @@ -452,7 +452,7 @@ RSB OPT_compile(TDBB tdbb, if (rsb) { i = local_streams[0]; - river = new(*tdbb->tdbb_default, i) riv(); + river = FB_NEW_RPT(*tdbb->tdbb_default, i) riv(); river->riv_count = (UCHAR) i; river->riv_rsb = rsb; MOVE_FAST(local_streams + 1, river->riv_streams, i); @@ -942,7 +942,7 @@ void OPT_set_index(TDBB tdbb, /* set up a dummy optimizer block just for the purposes of the set index, to pass information to subroutines */ - opt = new(*dbb->dbb_permanent) Opt(); + opt = FB_NEW(*dbb->dbb_permanent) Opt(); opt->opt_g_flags |= opt_g_stream; /* generate a new rsb for the retrieval, making sure to @@ -2902,7 +2902,7 @@ static BOOLEAN form_river(TDBB tdbb, SET_TDBB(tdbb); csb = opt->opt_csb; /* Allocate a river block and move the best order into it */ - river = new(*tdbb->tdbb_default, count) riv(); + river = FB_NEW_RPT(*tdbb->tdbb_default, count) riv(); LLS_PUSH(river, river_stack); river->riv_count = (UCHAR) count; if (count == 1) { @@ -2910,7 +2910,7 @@ static BOOLEAN form_river(TDBB tdbb, ptr = &river->riv_rsb; } else { - river->riv_rsb = rsb = new(*tdbb->tdbb_default, count) Rsb(); + river->riv_rsb = rsb = FB_NEW_RPT(*tdbb->tdbb_default, count) Rsb(); rsb->rsb_type = rsb_cross; rsb->rsb_count = count; rsb->rsb_impure = CMP_impure(csb, sizeof(struct irsb)); @@ -3005,7 +3005,7 @@ static RSB gen_aggregate(TDBB tdbb, OPT opt, NOD node) /* allocate and optimize the record source block */ - rsb = new(*tdbb->tdbb_default, 1) Rsb(); + rsb = FB_NEW_RPT(*tdbb->tdbb_default, 1) Rsb(); rsb->rsb_type = rsb_aggregate; rsb->rsb_stream = (UCHAR) node->nod_arg[e_agg_stream]; rsb->rsb_format = csb->csb_rpt[rsb->rsb_stream].csb_format; @@ -3096,7 +3096,7 @@ static RSB gen_boolean(TDBB tdbb, register OPT opt, RSB prior_rsb, NOD node) DEV_BLKCHK(prior_rsb, type_rsb); SET_TDBB(tdbb); csb = opt->opt_csb; - rsb = new(*tdbb->tdbb_default, 1) Rsb(); + rsb = FB_NEW_RPT(*tdbb->tdbb_default, 1) Rsb(); rsb->rsb_count = 1; rsb->rsb_type = rsb_boolean; rsb->rsb_next = prior_rsb; @@ -3131,7 +3131,7 @@ static RSB gen_first(TDBB tdbb, register OPT opt, RSB prior_rsb, NOD node) DEV_BLKCHK(node, type_nod); SET_TDBB(tdbb); csb = opt->opt_csb; - rsb = new(*tdbb->tdbb_default, 1) Rsb(); + rsb = FB_NEW_RPT(*tdbb->tdbb_default, 1) Rsb(); rsb->rsb_count = 1; rsb->rsb_type = rsb_first; rsb->rsb_next = prior_rsb; @@ -3194,7 +3194,7 @@ static void gen_join(TDBB tdbb, relation) * dbb->dbb_page_size / format->fmt_length;} - river = new(*tdbb->tdbb_default, 1) riv(); + river = FB_NEW_RPT(*tdbb->tdbb_default, 1) riv(); river->riv_count = 1; river->riv_rsb = gen_retrieval(tdbb, opt, streams[1], sort_clause, project_clause, @@ -3408,7 +3408,7 @@ static RSB gen_nav_rsb(TDBB tdbb, DEV_BLKCHK(alias, type_str); SET_TDBB(tdbb); key_length = ROUNDUP(BTR_key_length(relation, idx), sizeof(SLONG)); - rsb = new(*tdbb->tdbb_default, RSB_NAV_count) Rsb(); + rsb = FB_NEW_RPT(*tdbb->tdbb_default, RSB_NAV_count) Rsb(); rsb->rsb_type = rsb_navigate; rsb->rsb_relation = relation; rsb->rsb_stream = (UCHAR) stream; @@ -3524,7 +3524,7 @@ static RSB gen_outer(TDBB tdbb, stream_i.stream_rsb = gen_residual_boolean(tdbb, opt, stream_i.stream_rsb); /* Allocate and fill in the rsb */ - rsb = new(*tdbb->tdbb_default, RSB_LEFT_count) Rsb(); + rsb = FB_NEW_RPT(*tdbb->tdbb_default, RSB_LEFT_count) Rsb(); rsb->rsb_type = rsb_left_cross; rsb->rsb_count = 2; rsb->rsb_impure = CMP_impure(opt->opt_csb, sizeof(struct irsb)); @@ -3567,7 +3567,7 @@ static RSB gen_procedure(TDBB tdbb, OPT opt, NOD node) SET_TDBB(tdbb); csb = opt->opt_csb; procedure = (PRC) node->nod_arg[e_prc_procedure]; - rsb = new(*tdbb->tdbb_default, RSB_PRC_count) Rsb(); + rsb = FB_NEW_RPT(*tdbb->tdbb_default, RSB_PRC_count) Rsb(); rsb->rsb_type = rsb_procedure; rsb->rsb_stream = (UCHAR) node->nod_arg[e_prc_stream]; rsb->rsb_procedure = procedure; @@ -3890,14 +3890,14 @@ static RSB gen_rsb(TDBB tdbb, } else { if (inversion) { - rsb = new(*tdbb->tdbb_default, 1) Rsb(); + rsb = FB_NEW_RPT(*tdbb->tdbb_default, 1) Rsb(); rsb->rsb_type = rsb_indexed; rsb->rsb_count = 1; size = sizeof(struct irsb_index); rsb->rsb_arg[0] = (RSB) inversion; } else { - rsb = new(*tdbb->tdbb_default, 0) Rsb(); + rsb = FB_NEW_RPT(*tdbb->tdbb_default, 0) Rsb(); rsb->rsb_type = rsb_sequential; size = sizeof(struct irsb); if (boolean) @@ -3953,7 +3953,7 @@ static RSB gen_skip (TDBB tdbb, register OPT opt, RSB prior_rsb, NOD node) SET_TDBB (tdbb); csb = opt->opt_csb; - rsb = new(*tdbb->tdbb_default, 0) Rsb(); // was : rsb = (RSB) ALLOCDV (type_rsb, 1); + rsb = FB_NEW_RPT(*tdbb->tdbb_default, 0) Rsb(); // was : rsb = (RSB) ALLOCDV (type_rsb, 1); rsb->rsb_count = 1; rsb->rsb_type = rsb_skip; rsb->rsb_next = prior_rsb; @@ -4049,7 +4049,7 @@ static RSB gen_sort(TDBB tdbb, count = items + (sizeof(SKD) * 2 * sort->nod_count + sizeof(smb_repeat) - 1) / sizeof(smb_repeat); - map = new(*tdbb->tdbb_default, count) smb(); + map = FB_NEW_RPT(*tdbb->tdbb_default, count) smb(); map->smb_keys = sort->nod_count * 2; map->smb_count = items; if (project_flag) @@ -4212,7 +4212,7 @@ static RSB gen_sort(TDBB tdbb, /* That was most unpleasant. Never the less, it's done (except for the debugging). All that remains is to build the record source block for the sort. */ - rsb = new(*tdbb->tdbb_default, 1) Rsb(); + rsb = FB_NEW_RPT(*tdbb->tdbb_default, 1) Rsb(); rsb->rsb_type = rsb_sort; rsb->rsb_next = prior_rsb; rsb->rsb_arg[0] = (RSB) map; @@ -4335,7 +4335,7 @@ static BOOLEAN gen_sort_merge(TDBB tdbb, OPT opt, LLS * org_rivers) *selected_class = NULL; class_cnt = selected_class - selected_classes; /* Build a sort stream */ - merge_rsb = new(*tdbb->tdbb_default, river_cnt * 2) Rsb(); + merge_rsb = FB_NEW_RPT(*tdbb->tdbb_default, river_cnt * 2) Rsb(); merge_rsb->rsb_count = river_cnt; merge_rsb->rsb_type = rsb_merge; merge_rsb->rsb_impure = CMP_impure(opt->opt_csb, @@ -4352,7 +4352,7 @@ static BOOLEAN gen_sort_merge(TDBB tdbb, OPT opt, LLS * org_rivers) if (!(TEST_DEP_BIT(selected_rivers, river1->riv_number))) continue; stream_cnt += river1->riv_count; - sort = new(*tdbb->tdbb_default, class_cnt * 2) nod(); + sort = FB_NEW_RPT(*tdbb->tdbb_default, class_cnt * 2) nod(); sort->nod_type = nod_sort; sort->nod_count = class_cnt; for (selected_class = selected_classes, ptr = sort->nod_arg; @@ -4367,7 +4367,7 @@ static BOOLEAN gen_sort_merge(TDBB tdbb, OPT opt, LLS * org_rivers) /* Finally, merge selected rivers into a single river, and rebuild original river stack */ - river1 = new(*tdbb->tdbb_default, stream_cnt) riv(); + river1 = FB_NEW_RPT(*tdbb->tdbb_default, stream_cnt) riv(); river1->riv_count = (UCHAR) stream_cnt; river1->riv_rsb = merge_rsb; stream = river1->riv_streams; @@ -4429,7 +4429,7 @@ static RSB gen_union(TDBB tdbb, clauses = union_node->nod_arg[e_uni_clauses]; count = clauses->nod_count; csb = opt->opt_csb; - rsb = new(*tdbb->tdbb_default, count + nstreams + 1) Rsb(); + rsb = FB_NEW_RPT(*tdbb->tdbb_default, count + nstreams + 1) Rsb(); rsb->rsb_type = rsb_union; rsb->rsb_count = count; rsb->rsb_stream = (UCHAR) union_node->nod_arg[e_uni_stream]; @@ -4525,7 +4525,7 @@ static IRL indexed_relationship(TDBB tdbb, OPT opt, USHORT stream) tail = opt->opt_rpt; if (tail->opt_lower || tail->opt_upper) { if (!relationship) - relationship = new(*tdbb->tdbb_default) irl(); + relationship = FB_NEW(*tdbb->tdbb_default) irl(); if (idx->idx_flags & idx_unique) { relationship->irl_unique = TRUE; break; @@ -4580,7 +4580,7 @@ static STR make_alias(TDBB tdbb, CSB csb, csb_repeat * base_tail) /* allocate a string block to hold the concatenated alias */ - alias = new(*tdbb->tdbb_default, alias_length) str(); + alias = FB_NEW_RPT(*tdbb->tdbb_default, alias_length) str(); alias->str_length = alias_length - 1; /* now concatenate the individual aliases into the string block, beginning at the end and copying back to the beginning */ @@ -4666,7 +4666,7 @@ static RSB make_cross(TDBB tdbb, OPT opt, LLS stack) } csb = opt->opt_csb; - rsb = new(*tdbb->tdbb_default, count) Rsb(); + rsb = FB_NEW_RPT(*tdbb->tdbb_default, count) Rsb(); rsb->rsb_type = rsb_cross; rsb->rsb_count = count; rsb->rsb_impure = CMP_impure(csb, sizeof(struct irsb)); @@ -4710,7 +4710,7 @@ static NOD make_index_node(TDBB tdbb, REL relation, CSB csb, IDX * idx) node = PAR_make_node(tdbb, e_idx_length); node->nod_type = nod_index; node->nod_count = 0; - retrieval = new(*tdbb->tdbb_default, idx->idx_count * 2) irb(); + retrieval = FB_NEW_RPT(*tdbb->tdbb_default, idx->idx_count * 2) irb(); node->nod_arg[e_idx_retrieval] = (NOD) retrieval; retrieval->irb_index = idx->idx_id; MOVE_FAST(idx, &retrieval->irb_desc, sizeof(retrieval->irb_desc)); diff --git a/src/jrd/os/darwin/mod_loader.cpp b/src/jrd/os/darwin/mod_loader.cpp index 208ede6a95..3848b8f4ed 100644 --- a/src/jrd/os/darwin/mod_loader.cpp +++ b/src/jrd/os/darwin/mod_loader.cpp @@ -95,7 +95,7 @@ ModuleLoader::Module *ModuleLoader::loadModule(const Firebird::string& modPath) init(); } - return new(*getDefaultMemoryPool()) DarwinModule(mod_handle); + return FB_NEW(*getDefaultMemoryPool()) DarwinModule(mod_handle); } DarwinModule::~DarwinModule() diff --git a/src/jrd/os/posix/mod_loader.cpp b/src/jrd/os/posix/mod_loader.cpp index ccf448a9c7..0b04d1112d 100644 --- a/src/jrd/os/posix/mod_loader.cpp +++ b/src/jrd/os/posix/mod_loader.cpp @@ -53,7 +53,7 @@ ModuleLoader::Module *ModuleLoader::loadModule(const Firebird::string& modPath) if (module == NULL) return 0; - return new(*getDefaultMemoryPool()) DlfcnModule(module); + return FB_NEW(*getDefaultMemoryPool()) DlfcnModule(module); } DlfcnModule::~DlfcnModule() diff --git a/src/jrd/os/posix/path_utils.cpp b/src/jrd/os/posix/path_utils.cpp index 6cf2d01715..79ce58ab8b 100644 --- a/src/jrd/os/posix/path_utils.cpp +++ b/src/jrd/os/posix/path_utils.cpp @@ -57,7 +57,7 @@ const PosixDirItr& PosixDirItr::operator++() PathUtils::dir_iterator *PathUtils::newDirItr(MemoryPool& p, const Firebird::string& path) { - return new(p) PosixDirItr(path); + return FB_NEW(p) PosixDirItr(path); } void PathUtils::splitLastComponent(Firebird::string& path, Firebird::string& file, diff --git a/src/jrd/os/win32/mod_loader.cpp b/src/jrd/os/win32/mod_loader.cpp index 6ee91a0e71..8d1bd66209 100644 --- a/src/jrd/os/win32/mod_loader.cpp +++ b/src/jrd/os/win32/mod_loader.cpp @@ -40,7 +40,7 @@ ModuleLoader::Module *ModuleLoader::loadModule(const Firebird::string& modPath) if (!module) return 0; - return new(*getDefaultMemoryPool()) Win32Module(module); + return FB_NEW(*getDefaultMemoryPool()) Win32Module(module); } Win32Module::~Win32Module() diff --git a/src/jrd/os/win32/path_utils.cpp b/src/jrd/os/win32/path_utils.cpp index 9d23b2400a..3e9620ee74 100644 --- a/src/jrd/os/win32/path_utils.cpp +++ b/src/jrd/os/win32/path_utils.cpp @@ -61,7 +61,7 @@ const PathUtils::dir_iterator& Win32DirItr::operator++() PathUtils::dir_iterator *PathUtils::newDirItr(MemoryPool& p, const Firebird::string& path) { - return new(p) Win32DirItr(path); + return FB_NEW(p) Win32DirItr(path); } void PathUtils::splitLastComponent(Firebird::string& path, Firebird::string& file, diff --git a/src/jrd/os2.cpp b/src/jrd/os2.cpp index 0fa86eb22a..11ee5e0fde 100644 --- a/src/jrd/os2.cpp +++ b/src/jrd/os2.cpp @@ -601,7 +601,7 @@ static FIL setup_file( /* Allocate file block and copy file name string */ - file = new(*dbb->dbb_permanent, file_length + 1) fil(); + file = FB_NEW_RPT(*dbb->dbb_permanent, file_length + 1) fil(); file->fil_desc = desc; file->fil_length = file_length; file->fil_max_page = -1; @@ -616,7 +616,7 @@ static FIL setup_file( /* Build unique lock string for file and construct lock block */ - dbb->dbb_lock = lock = new(*dbb->dbb_permanent, file_length) lck(); + dbb->dbb_lock = lock = FB_NEW_RPT(*dbb->dbb_permanent, file_length) lck(); lock->lck_type = LCK_database; lock->lck_owner_handle = LCK_get_owner_handle(NULL_TDBB, lock->lck_type); lock->lck_object = reinterpret_cast(dbb); diff --git a/src/jrd/pag.cpp b/src/jrd/pag.cpp index d7e36e62ff..cf6660b3d0 100644 --- a/src/jrd/pag.cpp +++ b/src/jrd/pag.cpp @@ -715,7 +715,7 @@ SLONG PAG_attachment_id(void) /* Take out lock on attachment id */ - lock = attachment->att_id_lock = new(*dbb->dbb_permanent, sizeof(SLONG)) lck(); + lock = attachment->att_id_lock = FB_NEW_RPT(*dbb->dbb_permanent, sizeof(SLONG)) lck(); lock->lck_type = LCK_attachment; lock->lck_owner_handle = LCK_get_owner_handle(tdbb, lock->lck_type); lock->lck_parent = dbb->dbb_lock; @@ -1152,7 +1152,7 @@ void PAG_init(void) dbb = tdbb->tdbb_database; CHECK_DBB(dbb); - dbb->dbb_pcontrol = control = new(*dbb->dbb_permanent) pgc(); + dbb->dbb_pcontrol = control = FB_NEW(*dbb->dbb_permanent) pgc(); control->pgc_bytes = dbb->dbb_page_size - OFFSETA(PIP, pip_bits); control->pgc_ppp = control->pgc_bytes * 8; control->pgc_tpt = diff --git a/src/jrd/par.cpp b/src/jrd/par.cpp index 6416f76f37..b5541ff140 100644 --- a/src/jrd/par.cpp +++ b/src/jrd/par.cpp @@ -25,7 +25,7 @@ * 2001.07.28: Added parse code for blr_skip to support LIMIT. */ /* -$Id: par.cpp,v 1.11 2002-09-10 18:34:00 skidder Exp $ +$Id: par.cpp,v 1.12 2002-09-25 17:12:10 skidder Exp $ */ #include "firebird.h" @@ -365,7 +365,7 @@ NOD PAR_gen_field(TDBB tdbb, USHORT stream, USHORT id) SET_TDBB(tdbb); - node = new(*tdbb->tdbb_default, e_fld_length) nod(); + node = FB_NEW_RPT(*tdbb->tdbb_default, e_fld_length) nod(); node->nod_type = nod_field; node->nod_arg[e_fld_id] = (NOD) (SLONG) id; node->nod_arg[e_fld_stream] = (NOD) (SLONG) stream; @@ -499,7 +499,7 @@ NOD PAR_make_node(TDBB tdbb, int size) SET_TDBB(tdbb); - node = new(*tdbb->tdbb_default, size) nod(); + node = FB_NEW_RPT(*tdbb->tdbb_default, size) nod(); node->nod_count = size; return node; @@ -783,7 +783,7 @@ static XCP par_condition(TDBB tdbb, CSB * csb) /* allocate a node to represent the conditions list */ - exception_list = new(*tdbb->tdbb_default, 1) xcp(); + exception_list = FB_NEW_RPT(*tdbb->tdbb_default, 1) xcp(); exception_list->xcp_count = 1; code_type = BLR_BYTE; switch (code_type) { @@ -850,7 +850,7 @@ static XCP par_conditions(TDBB tdbb, CSB * csb) /* allocate a node to represent the conditions list */ n = BLR_WORD; - exception_list = new(*tdbb->tdbb_default, n) xcp(); + exception_list = FB_NEW_RPT(*tdbb->tdbb_default, n) xcp(); exception_list->xcp_count = n; for (i = 0; i < n; i++) { code_type = BLR_BYTE; @@ -977,7 +977,7 @@ static void par_dependency( node->nod_arg[e_dep_field] = field_node = PAR_make_node(tdbb, 1); field_node->nod_type = nod_literal; length = strlen(field_name); - string = new(*tdbb->tdbb_default, length) str(); + string = FB_NEW_RPT(*tdbb->tdbb_default, length) str(); string->str_length = length; strcpy(reinterpret_cast < char *>(string->str_data), field_name); field_node->nod_arg[0] = (NOD) string->str_data; @@ -1913,7 +1913,7 @@ static NOD par_relation( id = BLR_WORD; if (operator_ == blr_rid2) { length = BLR_PEEK; - alias_string = new(*tdbb->tdbb_default, length + 1) str(); + alias_string = FB_NEW_RPT(*tdbb->tdbb_default, length + 1) str(); alias_string->str_length = length; par_name(csb, reinterpret_cast < char *>(alias_string->str_data)); } @@ -1926,7 +1926,7 @@ static NOD par_relation( par_name(csb, name); if (operator_ == blr_relation2) { length = BLR_PEEK; - alias_string = new(*tdbb->tdbb_default, length + 1) str(); + alias_string = FB_NEW_RPT(*tdbb->tdbb_default, length + 1) str(); alias_string->str_length = length; par_name(csb, reinterpret_cast < char *>(alias_string->str_data)); } diff --git a/src/jrd/plugin_manager.cpp b/src/jrd/plugin_manager.cpp index acb2008ce6..45afe28e64 100644 --- a/src/jrd/plugin_manager.cpp +++ b/src/jrd/plugin_manager.cpp @@ -101,7 +101,7 @@ void PluginManager::loadAllPlugins() // as defined by the host os, then by all means load it! if (!alreadyLoaded && ModuleLoader::isLoadableModule(**dirItr)) { - Module *mod = new(*getDefaultMemoryPool()) PluginModule(**dirItr, + Module *mod = FB_NEW(*getDefaultMemoryPool()) PluginModule(**dirItr, ModuleLoader::loadModule(**dirItr)); if (moduleList) { @@ -143,13 +143,13 @@ PluginManager::Module *PluginManager::loadPluginModule(const Firebird::string& n if (ModuleLoader::isLoadableModule(checkPath)) { - return new(*getDefaultMemoryPool()) PluginModule(checkPath, + return FB_NEW(*getDefaultMemoryPool()) PluginModule(checkPath, ModuleLoader::loadModule(checkPath)); } ModuleLoader::doctorModuleExtention(checkPath); if (ModuleLoader::isLoadableModule(checkPath)) { - return new(*getDefaultMemoryPool()) PluginModule(checkPath, + return FB_NEW(*getDefaultMemoryPool()) PluginModule(checkPath, ModuleLoader::loadModule(checkPath)); } } @@ -180,14 +180,14 @@ PluginManager::Module *PluginManager::loadPluginModule(const Firebird::string& n // OK, the module has the correct prefix path, lets try to load it. if (ModuleLoader::isLoadableModule(name)) { - return new(*getDefaultMemoryPool()) PluginModule(name, + return FB_NEW(*getDefaultMemoryPool()) PluginModule(name, ModuleLoader::loadModule(name)); } checkPath = name; ModuleLoader::doctorModuleExtention(checkPath); if (ModuleLoader::isLoadableModule(checkPath)) { - return new(*getDefaultMemoryPool()) PluginModule(checkPath, + return FB_NEW(*getDefaultMemoryPool()) PluginModule(checkPath, ModuleLoader::loadModule(checkPath)); } } diff --git a/src/jrd/rec.cpp b/src/jrd/rec.cpp index 6d6c083320..cbc8e9fade 100644 --- a/src/jrd/rec.cpp +++ b/src/jrd/rec.cpp @@ -1053,7 +1053,7 @@ USHORT activate_shadow, SLONG * timestamp, SLONG page_no, PAG page) else if (!WALRS_handle) ERR_post(gds_wal_failure, 0); - string = new(*dbb->dbb_permanent, MAX_WALBUFLEN) str(); + string = FB_NEW_RPT(*dbb->dbb_permanent, MAX_WALBUFLEN) str(); wal_buff = (UCHAR *) string->str_data; while (TRUE) { diff --git a/src/jrd/rlck.cpp b/src/jrd/rlck.cpp index a04c13c92d..12957d6b8f 100644 --- a/src/jrd/rlck.cpp +++ b/src/jrd/rlck.cpp @@ -300,7 +300,7 @@ LCK RLCK_record_locking(REL relation) tdbb = GET_THREAD_DATA; dbb = GET_DBB; - lock = new(*dbb->dbb_permanent, sizeof(SLONG)) lck(); + lock = FB_NEW_RPT(*dbb->dbb_permanent, sizeof(SLONG)) lck(); lock->lck_parent = dbb->dbb_lock; lock->lck_dbb = dbb; lock->lck_attachment = tdbb->tdbb_attachment; @@ -555,7 +555,7 @@ void RLCK_signal_refresh(TRA transaction) /* allocate a local lock */ - local_lock = new(*dbb->dbb_permanent, sizeof(SLONG)) lck(); + local_lock = FB_NEW_RPT(*dbb->dbb_permanent, sizeof(SLONG)) lck(); local_lock->lck_dbb = dbb; local_lock->lck_attachment = tdbb->tdbb_attachment; local_lock->lck_length = sizeof(SLONG); @@ -797,7 +797,7 @@ static LCK allocate_record_lock(TRA transaction, RPB * rpb) if (!rpb->rpb_record) ERR_post(gds_no_cur_rec, 0); /* allocate a lock block for the record lock */ - lock = new(*dbb->dbb_permanent, sizeof(SLONG)) lck(); + lock = FB_NEW_RPT(*dbb->dbb_permanent, sizeof(SLONG)) lck(); lock->lck_dbb = dbb; lock->lck_attachment = attachment; lock->lck_object = reinterpret_cast(dbb); @@ -850,7 +850,7 @@ static LCK allocate_relation_lock(MemoryPool* pool, REL relation) LCK lock; tdbb = GET_THREAD_DATA; dbb = tdbb->tdbb_database; - lock = new(*pool, sizeof(SLONG)) lck(); + lock = FB_NEW_RPT(*pool, sizeof(SLONG)) lck(); lock->lck_dbb = dbb; lock->lck_attachment = tdbb->tdbb_attachment; lock->lck_length = sizeof(SLONG); diff --git a/src/jrd/rng.cpp b/src/jrd/rng.cpp index 21ce7e9721..c0991bf848 100644 --- a/src/jrd/rng.cpp +++ b/src/jrd/rng.cpp @@ -424,7 +424,7 @@ DSC *RNG_begin(NOD node, VLU impure) /* allocate the range block and move the event name into it */ - refresh_range = new(*tdbb->tdbb_default, p - event_name + 1) rng(); + refresh_range = FB_NEW_RPT(*tdbb->tdbb_default, p - event_name + 1) rng(); refresh_range->rng_event_length = p - event_name; strcpy(refresh_range->rng_event, event_name); diff --git a/src/jrd/rse.cpp b/src/jrd/rse.cpp index d11b9d8e8f..50ebea5bd1 100644 --- a/src/jrd/rse.cpp +++ b/src/jrd/rse.cpp @@ -20,7 +20,7 @@ * All Rights Reserved. * Contributor(s): ______________________________________. * - * $Id: rse.cpp,v 1.7 2002-08-22 08:20:27 dimitr Exp $ + * $Id: rse.cpp,v 1.8 2002-09-25 17:12:11 skidder Exp $ * * 2001.07.28: John Bellardo: Implemented rse_skip and made rse_first work with * seekable streams. @@ -2025,7 +2025,7 @@ static BOOLEAN get_procedure(TDBB tdbb, if (!impure->irsb_message) { size = msg_format->fmt_length + ALIGNMENT; - impure->irsb_message = new(*tdbb->tdbb_default, size) str(); + impure->irsb_message = FB_NEW_RPT(*tdbb->tdbb_default, size) str(); impure->irsb_message->str_length = size; } om = @@ -2035,7 +2035,7 @@ static BOOLEAN get_procedure(TDBB tdbb, if (!rpb->rpb_record) { record = rpb->rpb_record = - new(*tdbb->tdbb_default, rec_format->fmt_length) rec(); + FB_NEW_RPT(*tdbb->tdbb_default, rec_format->fmt_length) rec(); record->rec_format = rec_format; record->rec_length = rec_format->fmt_length; } @@ -3622,11 +3622,11 @@ static void save_record(TDBB tdbb, RPB * rpb) delete rec_copy; } else - rpb->rpb_copy = rpb_copy = new(*tdbb->tdbb_default) srpb(); + rpb->rpb_copy = rpb_copy = FB_NEW(*tdbb->tdbb_default) srpb(); MOVE_FAST(rpb, rpb_copy->srpb_rpb, sizeof(struct rpb)); rpb_copy->srpb_rpb->rpb_record = rec_copy = - new(*tdbb->tdbb_default, size) rec(); + FB_NEW_RPT(*tdbb->tdbb_default, size) rec(); rec_copy->rec_length = size; rec_copy->rec_format = record->rec_format; @@ -3681,7 +3681,7 @@ static void write_merge_block(TDBB tdbb, MFB mfb, ULONG block) SFB sfb_; if (!(sfb_ = mfb->mfb_sfb)) { - sfb_ = mfb->mfb_sfb = new(*getDefaultMemoryPool()) sfb; + sfb_ = mfb->mfb_sfb = FB_NEW(*getDefaultMemoryPool()) sfb; } if (!sfb_->sfb_file_name) { TEXT file_name[128]; diff --git a/src/jrd/sbm.cpp b/src/jrd/sbm.cpp index 46d9e76652..1ad507a52f 100644 --- a/src/jrd/sbm.cpp +++ b/src/jrd/sbm.cpp @@ -766,7 +766,7 @@ void SBM_set(TDBB tdbb, SBM * bitmap, SLONG number) SET_TDBB(tdbb); if (!(vector = *bitmap)) { - *bitmap = vector = new(*tdbb->tdbb_default) sbm(*tdbb->tdbb_default, 5); + *bitmap = vector = FB_NEW(*tdbb->tdbb_default) sbm(*tdbb->tdbb_default, 5); vector->sbm_type = SBM_ROOT; vector->sbm_count = 5; vector->sbm_state = SBM_SINGULAR; @@ -811,7 +811,7 @@ void SBM_set(TDBB tdbb, SBM * bitmap, SLONG number) if ( (bucket = tdbb->tdbb_default->plb_buckets) ) tdbb->tdbb_default->plb_buckets = bucket->sbm_next; else { - bucket = new(*tdbb->tdbb_default) + bucket = FB_NEW(*tdbb->tdbb_default) sbm(*tdbb->tdbb_default, BUNCH_BUCKET); bucket->sbm_pool = tdbb->tdbb_default; } @@ -845,7 +845,7 @@ void SBM_set(TDBB tdbb, SBM * bitmap, SLONG number) clear_segment(segment); } else { - segment = new(*tdbb->tdbb_default) bms(); + segment = FB_NEW(*tdbb->tdbb_default) bms(); segment->bms_pool = tdbb->tdbb_default; } vector->sbm_segments[slot] = segment; diff --git a/src/jrd/scl.epp b/src/jrd/scl.epp index 302756b080..f5748142ff 100644 --- a/src/jrd/scl.epp +++ b/src/jrd/scl.epp @@ -484,7 +484,7 @@ SCL SCL_get_class(/* INOUT */ TEXT* string) /* Class isn't known. So make up a new security class block */ - s_class = new(*dbb->dbb_permanent, p - name) scl(); + s_class = FB_NEW_RPT(*dbb->dbb_permanent, p - name) scl(); p = name; q = s_class->scl_name; while ( (*q++ = *p++) ) @@ -759,7 +759,7 @@ void SCL_init(BOOLEAN create, length = strlen(name) + strlen(role_name) + strlen(project) + strlen(organization) + 4; /* for the terminating nulls */ - tdbb->tdbb_attachment->att_user = user = new(*dbb->dbb_permanent, length) usr(); + tdbb->tdbb_attachment->att_user = user = FB_NEW_RPT(*dbb->dbb_permanent, length) usr(); p = user->usr_data; user->usr_user_name = save_string(name, &p); user->usr_project_name = save_string(project, &p); @@ -1019,7 +1019,7 @@ static BOOLEAN check_user_group(CONST TEXT* acl, try { - buffer = new(*dbb->dbb_permanent, *length_ptr) str(); + buffer = FB_NEW_RPT(*dbb->dbb_permanent, *length_ptr) str(); n = 0; if ( (l = *acl++) ) @@ -1141,7 +1141,7 @@ static SLONG compute_access(TDBB tdbb, try { /* Get some space that's not off the stack */ - str_buffer = new(*dbb->dbb_permanent, BLOB_BUFFER_SIZE) str(); + str_buffer = FB_NEW_RPT(*dbb->dbb_permanent, BLOB_BUFFER_SIZE) str(); buffer = (TEXT*) str_buffer->str_data; diff --git a/src/jrd/sdw.cpp b/src/jrd/sdw.cpp index d5dba76282..8b65d7c5e3 100644 --- a/src/jrd/sdw.cpp +++ b/src/jrd/sdw.cpp @@ -322,7 +322,7 @@ void SDW_check(void) } if (SDW_check_conditional()) { if (SDW_lck_update((SLONG) 0)) { - lock = new(*dbb->dbb_permanent, sizeof(SLONG)) lck(); + lock = FB_NEW_RPT(*dbb->dbb_permanent, sizeof(SLONG)) lck(); lock->lck_dbb = dbb; lock->lck_attachment = tdbb->tdbb_attachment; lock->lck_length = sizeof(SLONG); @@ -596,7 +596,7 @@ void SDW_init(USHORT activate, USHORT delete_, SBM sbm_rec) /* set up the lock block for synchronizing addition of new shadows */ key_length = sizeof(header->hdr_shadow_count); - dbb->dbb_shadow_lock = lock = new(*dbb->dbb_permanent, key_length) lck(); + dbb->dbb_shadow_lock = lock = FB_NEW_RPT(*dbb->dbb_permanent, key_length) lck(); lock->lck_type = LCK_shadow; lock->lck_owner_handle = LCK_get_owner_handle(tdbb, lock->lck_type); lock->lck_parent = dbb->dbb_lock; @@ -1197,7 +1197,7 @@ static SDW allocate_shadow( dbb = GET_DBB; - shadow = new(*dbb->dbb_permanent) sdw(); + shadow = FB_NEW(*dbb->dbb_permanent) sdw(); shadow->sdw_file = shadow_file; shadow->sdw_number = shadow_number; if (file_flags & FILE_manual) diff --git a/src/jrd/sort.cpp b/src/jrd/sort.cpp index c3ff02e864..428352516d 100644 --- a/src/jrd/sort.cpp +++ b/src/jrd/sort.cpp @@ -19,7 +19,7 @@ * * All Rights Reserved. * Contributor(s): ______________________________________. - * $Id: sort.cpp,v 1.11 2002-09-17 05:58:36 eku Exp $ + * $Id: sort.cpp,v 1.12 2002-09-25 17:12:11 skidder Exp $ * * 2001-09-24 SJL - Temporary fix for large sort file bug * @@ -1835,7 +1835,7 @@ static ULONG find_file_space(SCB scb, ULONG size, SFB * ret_sfb) // dimitr: allocate sort memory #ifdef SORT_MEM - sfb->sfb_mem = new (*getDefaultMemoryPool()) SortMem(sfb, size); + sfb->sfb_mem = FB_NEW (*getDefaultMemoryPool()) SortMem(sfb, size); #endif } diff --git a/src/jrd/sort_mem.cpp b/src/jrd/sort_mem.cpp index 597f976dca..61b9a82525 100644 --- a/src/jrd/sort_mem.cpp +++ b/src/jrd/sort_mem.cpp @@ -204,7 +204,7 @@ void SortMem::allocate(long size) // Allocate block in virtual memory try { - block = new (*getDefaultMemoryPool()) + block = FB_NEW (*getDefaultMemoryPool()) MemoryBlock(tail, smart_size); mem_allocated = true; } @@ -218,7 +218,7 @@ void SortMem::allocate(long size) smart_size = size; try { - block = new (*getDefaultMemoryPool()) + block = FB_NEW (*getDefaultMemoryPool()) MemoryBlock(tail, smart_size); mem_allocated = true; } @@ -236,7 +236,7 @@ void SortMem::allocate(long size) if (!mem_allocated) { // Allocate block on disk - block = new (*getDefaultMemoryPool()) + block = FB_NEW (*getDefaultMemoryPool()) FileBlock(tail, size, internal, file_size); physical_size += size; // We've just allocated some file storage diff --git a/src/jrd/sqz.cpp b/src/jrd/sqz.cpp index ea856d90e9..e8da20a286 100644 --- a/src/jrd/sqz.cpp +++ b/src/jrd/sqz.cpp @@ -464,7 +464,7 @@ USHORT SQZ_length(TDBB tdbb, SCHAR* data, int length, DCC dcc) } else { - dcc->dcc_next = new(*tdbb->tdbb_default) Dcc(); + dcc->dcc_next = FB_NEW(*tdbb->tdbb_default) Dcc(); dcc = dcc->dcc_next; dcc->dcc_pool = tdbb->tdbb_default; } @@ -502,7 +502,7 @@ USHORT SQZ_length(TDBB tdbb, SCHAR* data, int length, DCC dcc) } else { - dcc->dcc_next = new(*tdbb->tdbb_default) Dcc(); + dcc->dcc_next = FB_NEW(*tdbb->tdbb_default) Dcc(); dcc = dcc->dcc_next; dcc->dcc_pool = tdbb->tdbb_default; } diff --git a/src/jrd/svc.cpp b/src/jrd/svc.cpp index 3d715c01c0..65779dae2c 100644 --- a/src/jrd/svc.cpp +++ b/src/jrd/svc.cpp @@ -617,7 +617,7 @@ SVC SVC_attach(USHORT service_length, we cannot use the JRD allocator. */ // service = (SVC) gds__alloc((SLONG) (sizeof(struct svc))); - service = new(*getDefaultMemoryPool()) svc; + service = FB_NEW(*getDefaultMemoryPool()) svc; /* FREE: by exception handler */ if (!service) ERR_post(isc_virmemexh, 0); diff --git a/src/jrd/tpc.cpp b/src/jrd/tpc.cpp index 73b517f9b6..80eb5341a7 100644 --- a/src/jrd/tpc.cpp +++ b/src/jrd/tpc.cpp @@ -246,7 +246,7 @@ int TPC_snapshot_state(TDBB tdbb, SLONG number) // receiver of this (ptr) checks its type. // Please review this. This lock has _nothing_ to do in the // permamnent pool! - std::auto_ptr temp_lock(new(*dbb->dbb_permanent, 0) lck); + std::auto_ptr temp_lock(FB_NEW_RPT(*dbb->dbb_permanent, 0) lck); //temp_lock.blk_type = type_lck; temp_lock->lck_dbb = dbb; @@ -365,7 +365,7 @@ static TPC allocate_tpc(TDBB tdbb, ULONG base) /* allocate a TIP cache block with enough room for all desired transactions */ - tip_cache = new(*dbb->dbb_permanent, trans_per_tip / 4) tpc(); + tip_cache = FB_NEW_RPT(*dbb->dbb_permanent, trans_per_tip / 4) tpc(); tip_cache->tpc_base = base; return tip_cache; diff --git a/src/jrd/tra.cpp b/src/jrd/tra.cpp index 5799827aa1..786811b33d 100644 --- a/src/jrd/tra.cpp +++ b/src/jrd/tra.cpp @@ -174,7 +174,7 @@ BOOLEAN TRA_active_transactions(TDBB tdbb, DBB dbb) base = oldest & ~TRA_MASK; - trans = new(*dbb->dbb_permanent, (number - base + TRA_MASK) / 4) tra(); + trans = FB_NEW_RPT(*dbb->dbb_permanent, (number - base + TRA_MASK) / 4) tra(); /* Build transaction bitmap to scan for active transactions. */ @@ -735,7 +735,7 @@ void TRA_init(TDBB tdbb) dbb = tdbb->tdbb_database; CHECK_DBB(dbb); - dbb->dbb_sys_trans = trans = new(*dbb->dbb_permanent, 0) tra(); + dbb->dbb_sys_trans = trans = FB_NEW_RPT(*dbb->dbb_permanent, 0) tra(); trans->tra_flags |= TRA_system | TRA_ignore_limbo; trans->tra_pool = dbb->dbb_permanent; } @@ -822,7 +822,7 @@ void TRA_post_resources(TDBB tdbb, TRA transaction, RSC resources) tra_rsc = tra_rsc->rsc_next) if (rsc->rsc_id == tra_rsc->rsc_id) break; if (!tra_rsc) { - new_rsc = new(*tdbb->tdbb_default) Rsc(); + new_rsc = FB_NEW(*tdbb->tdbb_default) Rsc(); new_rsc->rsc_next = transaction->tra_resources; transaction->tra_resources = new_rsc; new_rsc->rsc_id = rsc->rsc_id; @@ -1007,8 +1007,8 @@ TRA TRA_reconnect(TDBB tdbb, UCHAR * id, USHORT length) ERR_post(isc_read_only_database, 0); - tdbb->tdbb_default = new(*dbb->dbb_permanent) JrdMemoryPool; - trans = new(*tdbb->tdbb_default, 0) tra(); + tdbb->tdbb_default = FB_NEW(*dbb->dbb_permanent) JrdMemoryPool; + trans = FB_NEW_RPT(*tdbb->tdbb_default, 0) tra(); trans->tra_pool = tdbb->tdbb_default; trans->tra_number = gds__vax_integer(id, length); trans->tra_flags |= TRA_prepared | TRA_reconnected | TRA_write; @@ -1448,8 +1448,8 @@ TRA TRA_start(TDBB tdbb, int tpb_length, SCHAR * tpb) transaction block first, sieze relation locks, the go ahead and make up the real transaction block. */ - tdbb->tdbb_default = new(*dbb->dbb_permanent) JrdMemoryPool; - temp = new(*tdbb->tdbb_default, 0) tra; + tdbb->tdbb_default = FB_NEW(*dbb->dbb_permanent) JrdMemoryPool; + temp = FB_NEW_RPT(*tdbb->tdbb_default, 0) tra; temp->tra_pool = tdbb->tdbb_default; transaction_options(tdbb, temp, reinterpret_cast < UCHAR * >(tpb), tpb_length); @@ -1496,9 +1496,9 @@ TRA TRA_start(TDBB tdbb, int tpb_length, SCHAR * tpb) base = oldest & ~TRA_MASK; if (temp->tra_flags & TRA_read_committed) - trans = new(*tdbb->tdbb_default, 0) tra; + trans = FB_NEW_RPT(*tdbb->tdbb_default, 0) tra; else { - trans = new(*tdbb->tdbb_default, (number - base + TRA_MASK) / 4) tra; + trans = FB_NEW_RPT(*tdbb->tdbb_default, (number - base + TRA_MASK) / 4) tra; } trans->tra_pool = temp->tra_pool; @@ -1955,7 +1955,7 @@ LCK TRA_transaction_lock(TDBB tdbb, BLK object) SET_TDBB(tdbb); dbb = tdbb->tdbb_database; - lock = new(*tdbb->tdbb_default, sizeof(SLONG)) lck(); + lock = FB_NEW_RPT(*tdbb->tdbb_default, sizeof(SLONG)) lck(); lock->lck_type = LCK_tra; lock->lck_owner_handle = LCK_get_owner_handle(tdbb, lock->lck_type); lock->lck_length = sizeof(SLONG); @@ -2242,7 +2242,7 @@ static void compute_oldest_retaining( /* Get a commit retaining lock, if not present. */ if (!(lock = dbb->dbb_retaining_lock)) { - lock = new(*dbb->dbb_permanent, sizeof(SLONG)) lck(); + lock = FB_NEW_RPT(*dbb->dbb_permanent, sizeof(SLONG)) lck(); lock->lck_dbb = dbb; lock->lck_type = LCK_retaining; lock->lck_owner_handle = LCK_get_owner_handle(tdbb, lock->lck_type); diff --git a/src/jrd/unix.cpp b/src/jrd/unix.cpp index 0752613f68..b625bb6383 100644 --- a/src/jrd/unix.cpp +++ b/src/jrd/unix.cpp @@ -978,7 +978,7 @@ static FIL setup_file( /* Allocate file block and copy file name string */ - file = new(*dbb->dbb_permanent, file_length + 1) fil(); + file = FB_NEW_RPT(*dbb->dbb_permanent, file_length + 1) fil(); file->fil_desc = desc; file->fil_length = file_length; file->fil_max_page = -1; @@ -1012,7 +1012,7 @@ static FIL setup_file( l = p - lock_string; - dbb->dbb_lock = lock = new(*dbb->dbb_permanent, l) lck(); + dbb->dbb_lock = lock = FB_NEW_RPT(*dbb->dbb_permanent, l) lck(); lock->lck_type = LCK_database; lock->lck_owner_handle = LCK_get_owner_handle(NULL_TDBB, lock->lck_type); lock->lck_object = reinterpret_cast(dbb); diff --git a/src/jrd/val.cpp b/src/jrd/val.cpp index 15547ec152..18107a4fff 100644 --- a/src/jrd/val.cpp +++ b/src/jrd/val.cpp @@ -701,7 +701,7 @@ BOOLEAN VAL_validate(TDBB tdbb, USHORT switches) old_pool = tdbb->tdbb_default; val_pool = 0; - tdbb->tdbb_default = val_pool = new(*dbb->dbb_permanent) JrdMemoryPool; + tdbb->tdbb_default = val_pool = FB_NEW(*dbb->dbb_permanent) JrdMemoryPool; control.vdr_page_bitmap = NULL; control.vdr_flags = 0; diff --git a/src/jrd/val.h b/src/jrd/val.h index 220032f3e5..4aa8b16b61 100644 --- a/src/jrd/val.h +++ b/src/jrd/val.h @@ -53,7 +53,7 @@ public: { } static fmt* newFmt(MemoryPool& p, int len = 0) - { return new(p) fmt(p, len); } + { return FB_NEW(p) fmt(p, len); } USHORT fmt_length; USHORT fmt_count; diff --git a/src/jrd/vio.cpp b/src/jrd/vio.cpp index c76c7ed246..5de7e83f18 100644 --- a/src/jrd/vio.cpp +++ b/src/jrd/vio.cpp @@ -2149,7 +2149,7 @@ REC VIO_record(TDBB tdbb, register RPB * rpb, FMT format, JrdMemoryPool *pool) if (!(record = rpb->rpb_record)) { if (!pool) pool = dbb->dbb_permanent; - record = rpb->rpb_record = new(*pool, format->fmt_length) rec; + record = rpb->rpb_record = FB_NEW_RPT(*pool, format->fmt_length) rec; record->rec_length = format->fmt_length; } else if (record->rec_length < format->fmt_length) { @@ -2160,7 +2160,7 @@ REC VIO_record(TDBB tdbb, register RPB * rpb, FMT format, JrdMemoryPool *pool) format->fmt_length); else { - record = new(*MemoryPool::blk_pool(record), format->fmt_length) rec; + record = FB_NEW_RPT(*MemoryPool::blk_pool(record), format->fmt_length) rec; memcpy(record, rpb->rpb_record, sizeof(rec) + sizeof(SCHAR)*rpb->rpb_record->rec_length); delete rpb->rpb_record; rpb->rpb_record = record; @@ -2201,7 +2201,7 @@ void VIO_start_save_point(TDBB tdbb, TRA transaction) if ( (sav_point = transaction->tra_save_free) ) transaction->tra_save_free = sav_point->sav_next; else - sav_point = new(*transaction->tra_pool) sav(); + sav_point = FB_NEW(*transaction->tra_pool) sav(); sav_point->sav_number = ++transaction->tra_save_point_number; sav_point->sav_next = transaction->tra_save_point; @@ -3253,7 +3253,7 @@ static void THREAD_ROUTINE garbage_collector(DBB dbb) /* Pseudo attachment needed for lock owner identification. */ - tdbb->tdbb_attachment = new(*dbb->dbb_permanent) att(); + tdbb->tdbb_attachment = FB_NEW(*dbb->dbb_permanent) att(); tdbb->tdbb_attachment->att_database = dbb; tdbb->tdbb_attachment->att_flags = ATT_garbage_collector; @@ -3527,7 +3527,7 @@ static SAV get_free_save_point_block(TRA transaction) if ( (sav_point = transaction->tra_save_free) ) transaction->tra_save_free = sav_point->sav_next; else - sav_point = new(*transaction->tra_pool) sav(); + sav_point = FB_NEW(*transaction->tra_pool) sav(); return sav_point; } @@ -4158,7 +4158,7 @@ static REC replace_gc_record(REL relation, REC * gc_record, USHORT length) for (rec_ptr = vector->begin(), end = vector->end(); rec_ptr < end; ++rec_ptr) if (*rec_ptr == *gc_record) { - temp = new(*MemoryPool::blk_pool(*gc_record), length) rec; + temp = FB_NEW_RPT(*MemoryPool::blk_pool(*gc_record), length) rec; memcpy(temp, *rec_ptr, sizeof(rec) + sizeof(SCHAR)*(*gc_record)->rec_length); delete *rec_ptr; *rec_ptr = temp; @@ -4455,7 +4455,7 @@ static void verb_post( if ( (action = transaction->tra_save_point->sav_verb_free) ) transaction->tra_save_point->sav_verb_free = action->vct_next; else - action = new(*tdbb->tdbb_default) vct(); + action = FB_NEW(*tdbb->tdbb_default) vct(); action->vct_next = transaction->tra_save_point->sav_verb_actions; transaction->tra_save_point->sav_verb_actions = action; action->vct_relation = rpb->rpb_relation; @@ -4468,7 +4468,7 @@ static void verb_post( savepoint hasn't seen this record before. */ SBM_set(tdbb, &action->vct_undo, rpb->rpb_number); - data = new(*tdbb->tdbb_default, old_data->rec_length) rec(); + data = FB_NEW_RPT(*tdbb->tdbb_default, old_data->rec_length) rec(); data->rec_number = rpb->rpb_number; data->rec_length = old_data->rec_length; data->rec_format = old_data->rec_format; @@ -4484,7 +4484,7 @@ static void verb_post( and this savepoint hasn't seen this record before. */ SBM_set(tdbb, &action->vct_undo, rpb->rpb_number); - data = new(*tdbb->tdbb_default, 1) rec; + data = FB_NEW_RPT(*tdbb->tdbb_default, 1) rec; data->rec_number = rpb->rpb_number; data->rec_length = 0; if (new_ver) @@ -4513,7 +4513,7 @@ static void verb_post( undo data. */ SBM_set(tdbb, &action->vct_undo, rpb->rpb_number); - data = new(*tdbb->tdbb_default, 1) rec(); + data = FB_NEW_RPT(*tdbb->tdbb_default, 1) rec(); data->rec_number = rpb->rpb_number; data->rec_length = 0; data->rec_flags |= (REC_same_tx | REC_new_version); diff --git a/src/jrd/vms.cpp b/src/jrd/vms.cpp index 254d3603b2..22b5386bf1 100644 --- a/src/jrd/vms.cpp +++ b/src/jrd/vms.cpp @@ -827,7 +827,7 @@ static FIL setup_file( /* Allocate file block and move in file name */ - file = new(dbb->dbb_permanent, file_length + 1) fil(); + file = FB_NEW_RPT(dbb->dbb_permanent, file_length + 1) fil(); file->fil_desc = chan; file->fil_length = file_length; file->fil_max_page = -1; @@ -875,7 +875,7 @@ static FIL setup_file( while (--l); l = p - lock_id; - dbb->dbb_lock = lock = new(dbb->dbb_permanent, l) lck(); + dbb->dbb_lock = lock = FB_NEW_RPT(dbb->dbb_permanent, l) lck(); lock->lck_type = LCK_database; lock->lck_owner_handle = LCK_get_owner_handle(NULL_TDBB, lock->lck_type); lock->lck_object = reinterpret_cast(dbb); diff --git a/src/jrd/windows.cpp b/src/jrd/windows.cpp index aabd5f6760..888e68a99e 100644 --- a/src/jrd/windows.cpp +++ b/src/jrd/windows.cpp @@ -665,7 +665,7 @@ static FIL setup_file( /* Allocate file block and copy file name string */ - file = new(dbb->dbb_permanent, file_length + 1) fil(); + file = FB_NEW_RPT(dbb->dbb_permanent, file_length + 1) fil(); file->fil_desc = desc; file->fil_length = file_length; file->fil_max_page = -1; @@ -687,7 +687,7 @@ static FIL setup_file( l = file_length; lock_string = file_name; - dbb->dbb_lock = lock = new(dbb->dbb_permanent, l) lck(); + dbb->dbb_lock = lock = FB_NEW_RPT(dbb->dbb_permanent, l) lck(); lock->lck_type = LCK_database; lock->lck_owner_handle = LCK_get_owner_handle(NULL_TDBB, lock->lck_type); lock->lck_object = reinterpret_cast(dbb); diff --git a/src/jrd/winnt.cpp b/src/jrd/winnt.cpp index 55b211503b..d2950e6401 100644 --- a/src/jrd/winnt.cpp +++ b/src/jrd/winnt.cpp @@ -1058,7 +1058,7 @@ static FIL setup_file(DBB dbb, /* Allocate file block and copy file name string */ - file = new(*dbb->dbb_permanent, file_length + 1) fil; + file = FB_NEW_RPT(*dbb->dbb_permanent, file_length + 1) fil; file->fil_desc = reinterpret_cast(desc); file->fil_force_write_desc = reinterpret_cast(INVALID_HANDLE_VALUE); @@ -1106,7 +1106,7 @@ static FIL setup_file(DBB dbb, l = p - lock_string; - dbb->dbb_lock = lock = new(*dbb->dbb_permanent, l) lck; + dbb->dbb_lock = lock = FB_NEW_RPT(*dbb->dbb_permanent, l) lck; lock->lck_type = LCK_database; lock->lck_owner_handle = LCK_get_owner_handle(NULL_TDBB, lock->lck_type); lock->lck_object = reinterpret_cast(dbb); diff --git a/src/utilities/dba.epp b/src/utilities/dba.epp index a7e4cf313d..c1240ac3d2 100644 --- a/src/utilities/dba.epp +++ b/src/utilities/dba.epp @@ -932,7 +932,7 @@ static SCHAR *alloc( SLONG size) TDBA tddba = GET_THREAD_DATA; - block = p = new(*getDefaultMemoryPool()) SCHAR[size]; + block = p = FB_NEW(*getDefaultMemoryPool()) SCHAR[size]; if (!p) { /* NOMEM: return error */ dba_error(31, 0, 0, 0, 0, 0); @@ -942,7 +942,7 @@ static SCHAR *alloc( SLONG size) *p++ = 0; while (--size); - mem* mem_list = new(*getDefaultMemoryPool()) mem; + mem* mem_list = FB_NEW(*getDefaultMemoryPool()) mem; if (!mem_list) { /* NOMEM: return error */ dba_error(31, 0, 0, 0, 0, 0); @@ -1361,7 +1361,7 @@ static DBA_FIL db_open( UCHAR * file_name, USHORT file_length) db_error(errno); } - file_list = new(*getDefaultMemoryPool()) open_files; + file_list = FB_NEW(*getDefaultMemoryPool()) open_files; if (!file_list) { /* NOMEM: return error */ dba_error(31, 0, 0, 0, 0, 0); @@ -1545,7 +1545,7 @@ static DBA_FIL db_open( UCHAR * file_name, USHORT file_length) } #ifdef SUPERSERVER - open_files* file_list = new(*getDefaultMemoryPool()) open_files; + open_files* file_list = FB_NEW(*getDefaultMemoryPool()) open_files; if (!file_list) { /* NOMEM: return error */ dba_error(31, 0, 0, 0, 0, 0); @@ -1734,7 +1734,7 @@ static DBA_FIL db_open( UCHAR * file_name, USHORT file_length) } #ifdef SUPERSERVER - file_list = new(*getDefaultMemoryPool()) open_files; + file_list = FB_NEW(*getDefaultMemoryPool()) open_files; if (!file_list) { /* NOMEM: return error */ dba_error(31, 0, 0, 0, 0, 0);