diff --git a/sr_port/lke_show.c b/sr_port/lke_show.c index f3b5ae26e..e839c729a 100755 --- a/sr_port/lke_show.c +++ b/sr_port/lke_show.c @@ -3,6 +3,9 @@ * Copyright (c) 2001-2017 Fidelity National Information * * Services, Inc. and/or its subsidiaries. All rights reserved. * * * + * Copyright (c) 2017 YottaDB LLC. and/or its subsidiaries. * + * All rights reserved. * + * * * This source code contains the intellectual property * * of its copyright holder(s), and is made available * * under a license. If you do not know the terms of * @@ -33,7 +36,6 @@ #include "hashtab_mname.h" /* needed for cmmdef.h */ #include "cmmdef.h" /* for gtcmtr_protos.h */ #include "util.h" -#include "longcpy.h" #include "gtcmtr_protos.h" #include "lke.h" #include "lke_getcli.h" @@ -113,7 +115,7 @@ void lke_show(void) /* Prevent any modification of the lock space while we make a local copy of it */ if (!nocrit) GRAB_LOCK_CRIT(csa, reg, was_crit); - longcpy((uchar_ptr_t)ctl, (uchar_ptr_t)csa->lock_addrs[0], ls_len); + memcpy((uchar_ptr_t)ctl, (uchar_ptr_t)csa->lock_addrs[0], ls_len); assert((ctl->max_blkcnt > 0) && (ctl->max_prccnt > 0) && ((ctl->subtop - ctl->subbase) > 0)); if (!nocrit) REL_LOCK_CRIT(csa, reg, was_crit); diff --git a/sr_port/longcpy.h b/sr_port/longcpy.h deleted file mode 100755 index 4eb8d2bba..000000000 --- a/sr_port/longcpy.h +++ /dev/null @@ -1,28 +0,0 @@ -/**************************************************************** - * * - * Copyright 2001, 2003 Sanchez Computer Associates, Inc. * - * * - * This source code contains the intellectual property * - * of its copyright holder(s), and is made available * - * under a license. If you do not know the terms of * - * the license, please stop and do not read further. * - * * - ****************************************************************/ - -#ifndef LONGCPY_INCLUDED -#define LONGCPY_INCLUDED - -/* - -To be one day eliminated when usage is totally replaced by the memcpy -calls it should be calling now instead. Since this is a stop-gap measure, -it is ok that this include pulls in gtm_string.h if necessary. - -void longcpy(uchar_ptr_t a, uchar_ptr_t b, int4 len); - - */ - -#include "gtm_string.h" -#define longcpy(dst, src, len) memcpy(dst, src, len) - -#endif /* LONGCPY_INCLUDED */ diff --git a/sr_port/lv_getslot.c b/sr_port/lv_getslot.c index 294c9609e..7e1d2848a 100644 --- a/sr_port/lv_getslot.c +++ b/sr_port/lv_getslot.c @@ -42,13 +42,13 @@ lv_val *lv_getslot(symval *sym) lv_val *lv; unsigned int numElems, numUsed; - numElems = MAXUINT4; /* maximum value */ if (lv = sym->lv_flist) { assert(NULL == LV_PARENT(lv)); /* stp_gcol relies on this for correct garbage collection */ sym->lv_flist = (lv_val *)lv->ptrs.free_ent.next_free; } else { + DEBUG_ONLY(numElems = MAXUINT4); /* maximum value */ for (p = sym->lv_first_block; ; p = p->next) { if (NULL == p) @@ -71,6 +71,8 @@ lv_val *lv_getslot(symval *sym) p->numUsed++; break; } + assert(numElems >= p->numAlloc); + DEBUG_ONLY(numElems = p->numAlloc); } } assert(lv); @@ -85,13 +87,13 @@ lvTree *lvtree_getslot(symval *sym) lvTree *lvt; unsigned int numElems, numUsed; - numElems = MAXUINT4; /* maximum value */ if (lvt = sym->lvtree_flist) { assert(NULL == LVT_GET_PARENT(lvt)); sym->lvtree_flist = (lvTree *)lvt->avl_root; } else { + DEBUG_ONLY(numElems = MAXUINT4); /* maximum value */ for (p = sym->lvtree_first_block; ; p = p->next) { if (NULL == p) @@ -126,13 +128,13 @@ lvTreeNode *lvtreenode_getslot(symval *sym) lvTreeNode *lv; unsigned int numElems, numUsed; - numElems = MAXUINT4; /* maximum value */ if (lv = sym->lvtreenode_flist) { assert(NULL == LV_PARENT(lv)); /* stp_gcol relies on this for correct garbage collection */ sym->lvtreenode_flist = (lvTreeNode *)lv->sbs_child; } else { + DEBUG_ONLY(numElems = MAXUINT4); /* maximum value */ for (p = sym->lvtreenode_first_block; ; p = p->next) { if (NULL == p) @@ -141,7 +143,7 @@ lvTreeNode *lvtreenode_getslot(symval *sym) numElems = p->numAlloc; else numElems = LV_NEWBLOCK_INIT_ALLOC; - lvtreenode_newblock(sym, (numElems < MAXINT4) ? (numElems * 2) : MAXINT4); + lvtreenode_newblock(sym, (numElems <= (MAXINT4 / 2)) ? (numElems * 2) : MAXINT4); p = sym->lvtreenode_first_block; assert(NULL != p); } diff --git a/sr_port/stp_expand_array.c b/sr_port/stp_expand_array.c index a634fb143..9ce71a157 100755 --- a/sr_port/stp_expand_array.c +++ b/sr_port/stp_expand_array.c @@ -13,10 +13,12 @@ ****************************************************************/ #include "mdef.h" + +#include "gtm_string.h" + #include "compiler.h" #include "stringpool.h" #include "stp_parms.h" -#include "longcpy.h" GBLREF mstr **stp_array; GBLREF gtm_uint64_t stp_array_size; @@ -30,7 +32,7 @@ void stp_expand_array(void) stp_array_size = ((MAXINT4 > n) ? (n * 2) : (n + MAXINT4)); a = stp_array; stp_array = (mstr **)malloc(stp_array_size * SIZEOF(mstr *)); - longcpy((uchar_ptr_t)stp_array, (uchar_ptr_t)a, n * SIZEOF(mstr *)); + memcpy((uchar_ptr_t)stp_array, (uchar_ptr_t)a, n * SIZEOF(mstr *)); free(a); return; } diff --git a/sr_port/stp_gcol_src.h b/sr_port/stp_gcol_src.h index ea196dc6a..2a02f153a 100644 --- a/sr_port/stp_gcol_src.h +++ b/sr_port/stp_gcol_src.h @@ -56,7 +56,6 @@ #include "zshow.h" #include "zwrite.h" #include "error.h" -#include "longcpy.h" #include "stpg_sort.h" #include "hashtab_objcode.h" #include "hashtab_str.h" diff --git a/sr_port/tp_hist.c b/sr_port/tp_hist.c index 3528f1019..01c4e1b78 100755 --- a/sr_port/tp_hist.c +++ b/sr_port/tp_hist.c @@ -3,6 +3,9 @@ * Copyright (c) 2001-2017 Fidelity National Information * * Services, Inc. and/or its subsidiaries. All rights reserved. * * * + * Copyright (c) 2017 YottaDB LLC. and/or its subsidiaries. * + * All rights reserved. * + * * * This source code contains the intellectual property * * of its copyright holder(s), and is made available * * under a license. If you do not know the terms of * @@ -13,6 +16,7 @@ #include "mdef.h" #include "gtm_string.h" + #include "gdsroot.h" #include "gdskill.h" #include "gdsblk.h" @@ -25,7 +29,6 @@ #include "copy.h" #include "jnl.h" #include "buddy_list.h" /* needed for tp.h */ -#include "longcpy.h" #include "hashtab_int4.h" /* needed for tp.h and cws_insert.h */ #include "tp.h" #include "longset.h" /* needed for cws_insert.h */ @@ -496,7 +499,7 @@ void gds_tp_hist_moved(sgm_info *si, srch_hist *hist1) assert(si->cur_tp_hist_size < si->tp_hist_size); si->cur_tp_hist_size <<= 1; new_first_tp_hist = (srch_blk_status *)malloc(SIZEOF(srch_blk_status) * si->cur_tp_hist_size); - longcpy((uchar_ptr_t)new_first_tp_hist, (uchar_ptr_t)si->first_tp_hist, + memcpy((uchar_ptr_t)new_first_tp_hist, (uchar_ptr_t)si->first_tp_hist, (sm_uc_ptr_t)si->last_tp_hist - (sm_uc_ptr_t)si->first_tp_hist); delta = (sm_long_t)((sm_uc_ptr_t)new_first_tp_hist - (sm_uc_ptr_t)si->first_tp_hist); for (tabent = si->blks_in_use->base, topent = si->blks_in_use->top; tabent < topent; tabent++) diff --git a/sr_port_cm/gtcmtr_lke_showrep.c b/sr_port_cm/gtcmtr_lke_showrep.c index dcd0f395b..5b0596995 100755 --- a/sr_port_cm/gtcmtr_lke_showrep.c +++ b/sr_port_cm/gtcmtr_lke_showrep.c @@ -3,6 +3,9 @@ * Copyright (c) 2001-2017 Fidelity National Information * * Services, Inc. and/or its subsidiaries. All rights reserved. * * * + * Copyright (c) 2017 YottaDB LLC. and/or its subsidiaries. * + * All rights reserved. * + * * * This source code contains the intellectual property * * of its copyright holder(s), and is made available * * under a license. If you do not know the terms of * @@ -19,6 +22,8 @@ #include "mdef.h" +#include "gtm_string.h" + #include #include "cmidef.h" @@ -39,7 +44,6 @@ #include "iosp.h" #include "gtcm_find_region.h" #include "gvcmz.h" -#include "longcpy.h" #include "interlock.h" #include "rel_quant.h" @@ -68,7 +72,7 @@ char gtcmtr_lke_showrep(struct CLB *lnk, show_request *sreq) lke_ctl = (mlk_ctldata *)malloc(ls_len); /* Prevent any modification of the lock space while we make a local copy of it */ GRAB_LOCK_CRIT(csa, gv_cur_region, was_crit); - longcpy((uchar_ptr_t)lke_ctl, csa->lock_addrs[0], ls_len); + memcpy((uchar_ptr_t)lke_ctl, csa->lock_addrs[0], ls_len); REL_LOCK_CRIT(csa, gv_cur_region, was_crit); util_cm_print(lnk, 0, NULL, RESET); dnode.len = sreq->nodelength; diff --git a/sr_port_cm/gtcmtr_lke_showreq.c b/sr_port_cm/gtcmtr_lke_showreq.c index 484cd98d7..3a1264ba5 100755 --- a/sr_port_cm/gtcmtr_lke_showreq.c +++ b/sr_port_cm/gtcmtr_lke_showreq.c @@ -1,6 +1,9 @@ /**************************************************************** * * - * Copyright 2001, 2009 Fidelity Information Services, Inc * + * Copyright 2001, 2009 Fidelity Information Services, Inc * + * * + * Copyright (c) 2017 YottaDB LLC. and/or its subsidiaries. * + * All rights reserved. * * * * This source code contains the intellectual property * * of its copyright holder(s), and is made available * @@ -40,7 +43,6 @@ #include "iosp.h" #include "gtcm_find_region.h" #include "gvcmz.h" -#include "longcpy.h" #define FLUSH 1