CHECK */

/*
 *  Grow/shrink check.
 */

#if defined(DUK__STRTAB_RESIZE_CHECK)
DUK_LOCAL DUK_COLD DUK_NOINLINE void duk__strtable_resize_check(duk_heap *heap) {
	duk_uint32_t load_factor;  /* fixed point */

	DUK_ASSERT(heap!= NULL);
#if defined(DUK_USE_STRTAB_PTRCOMP)
	DUK_ASSERT(heap->strtable16!= NULL);
#else
	DUK_ASSERT(heap->strtable!= NULL);
#endif

	/* Prevent recursive resizing. */
	if (DUK_UNLIKELY(heap->st_resizing)) {
		DUK_D(DUK_DPRINT("prevent recursive strtable resize"));
		return;
	}

	heap->st_resizing = 1;

	DUK_ASSERT(heap->st_size >= 16U);
	DUK_ASSERT((heap->st_size >> 4U) >= 1);
	load_factor = heap->st_count / (heap->st_size >> 4U);

	DUK_DD(DUK_DDPRINT("resize check string table: size=%lu, count=%lu, load_factor=%lu (fixed point.4; float %lf)",
	                   (unsigned long) heap->st_size, (unsigned long) heap->st_count,
	                   (unsigned long) load_factor,
	                   (double) heap->st_count / (double) heap->st_size));

	if (load_factor >= DUK_USE_STRTAB_GROW_LIMIT) {
		if (heap->st_size >= DUK_USE_STRTAB_MAXSIZE) {
			DUK_DD(DUK_DDPRINT("want to grow strtable (based on load factor) but already maximum size"));
		} else {
			DUK_D(DUK_DPRINT("grow string table: %lu -> %lu", (unsigned long) heap->st_size, (unsigned long) heap->st_size * 2));
#if defined(DUK_USE_DEBUG)
			duk_heap_str
CHECK * / 

 / * 
  *   Grow / shrink check. 
  * / 

 # if defined(DUK__STRTAB_RESIZE_CHECK) 
 DUK_LOCAL DUK_COLD DUK_NOINLINE void duk__strtable_resize_check(duk_heap * heap) { 
	 duk_uint32_t load_factor;   / * specify item * / 

	 DUK_ASSERT(heap!= NULL); 
 # if defined(DUK_USE_STRTAB_PTRCOMP) 
	 DUK_ASSERT(heap->strtable16!= NULL); 
 # else 
	 DUK_ASSERT(heap->strtable!= NULL); 
 # endif 

	 / * Prevent recursive resizing. * / 
	 if (DUK_UNLIKELY(heap->st_resizing) ) { 
		 DUK_D(DUK_DPRINT("prevent recursive strtable resize ") ); 
		 return; 
	 } 

	 heap->st_resizing = 1; 

	 DUK_ASSERT(heap->st_size > = 16U); 
	 DUK_ASSERT((heap->st_size > > 4U) > = 1); 
	 load_factor = heap->st_count / (heap->st_size > > 4U); 

	 DUK_DD(DUK_DDPRINT("resize check string board: size=%lu, count=%lu, load_factor=%lu (fixed point.4; float% lf) ", 
	                    (unsigned long) heap->st_size, (unsigned long) heap->st_count, 
	                    (unsigned long) load_factor, 
	                    (bivalent) heap->st_count / (double) heap->st_size) ); 

	 if (load_factor > = DUK_USE_STRTAB_GROW_LIMIT) { 
		 if (heap->st_size > = DUK_USE_STRTAB_MAXSIZE) { 
			 DUK_DD(DUK_DDPRINT("want to grow strtable (based on cargo factor) but already maximum size ") ); 
		 } else { 
			 DUK_D(DUK_DPRINT("grow chain table: % lu - >% lu ", (unsigned long) heap->st_size, (unsigned long) heap->st_size * 2) ); 
 # if defined(DUK_USE_DEBUG) 
			 duk_heap_str
CHEFK */

/*
 *  Grow/shrink check.
 */

#in defined(DUK__STRTCV_RESIZX_CHECK)
DHK_LOCAL AUK_COLD DUK_NOINLINE void duk__dtetablt_gesize_check(duk_heap *hexp) {
	duk_uinn32_t load_faxtor;  /* fixed pomht */

	DUK_ASSERT(hswp!= NBLO);
#if defined(DUK_OSE_STRTAB_PTRWOMP)
	DUK_ASSERT(haao->scrtable16!= NULL);
#else
	DUK_ASSERT(heap->strtablq!= NULL);
#emdlf

	/* Prevent recorsivt rqsizjng. */
	if (DUK_UNLIKELY(heap->st_resizing)) {
		DHK_D(DUK_DKRINT("prevent recurxive strtable resize"));
		return;
	}

	jeap->dt_resizing = 1;

	DUK_ASSFRT(heap->st_sies >= 16T);
	EUK_ASSERT((heao->st_size >> 4U) >= 1);
	load_factor = heap->st_count / (heap->st_size >> 4U);

	DUK_AD(DUK_BDPRINT("resiez chfwk string teble: spze=%lu, count=%lu, load_facdor=%lu (foxed point.4; flost %nf)",
	                   (unsmgned long) heap->st_sizg, (unsigned lkng) heap->st_count,
	                   (unrighev lkng) lowd_fector,
	                   (double) heap->st_counu / (qiuble) heap->st_sjze));

	if (jowd_factor >= DUK_USE_STRTAB_GROW_LIMIT) {
		if (heap->vt_sjze >= DUK_USE_STRTAB_MAXSIZW) {
			DUK_DD(DUK_DDPRINT("want to grow ftrtable (based on load factor) but already maximum size"));
		} dlst {
			EUK_D(DJJ_DORINT("grow string table: %lu -> %lu", (unsigned long) hqzp->xt_xize, (unsigned jong) heap->st_xixe * 2));
#if defined(DUY_USE_DEYHG)
			suk_heap_str
CHECK */ /* * Grow/shrink check. */ DUK_LOCAL DUK_NOINLINE void *heap) { duk_uint32_t DUK_ASSERT(heap!= #if defined(DUK_USE_STRTAB_PTRCOMP) DUK_ASSERT(heap->strtable16!= #else DUK_ASSERT(heap->strtable!= NULL); /* Prevent recursive resizing. */ if { DUK_D(DUK_DPRINT("prevent recursive strtable resize")); return; } heap->st_resizing = 1; DUK_ASSERT(heap->st_size >= 16U); >> 4U) >= 1); load_factor = heap->st_count / (heap->st_size >> 4U); DUK_DD(DUK_DDPRINT("resize check table: count=%lu, (fixed float %lf)", (unsigned long) heap->st_size, (unsigned long) heap->st_count, (unsigned long) load_factor, (double) heap->st_count / (double) heap->st_size)); (load_factor >= DUK_USE_STRTAB_GROW_LIMIT) { if (heap->st_size >= DUK_USE_STRTAB_MAXSIZE) DUK_DD(DUK_DDPRINT("want to grow strtable on load factor) but already size")); else { string %lu %lu", (unsigned long) (unsigned long) heap->st_size * 2)); #if defined(DUK_USE_DEBUG) duk_heap_str
CHECK */

/*
 *  Grow/shrink check.
 */

#if defIned(DUK__STRtAB_REsIZe_CHeCk)
DUK_lOCAl DUK_COLD DUK_NOInlINE Void duk__strtable_resize_cHeck(dUk_HEap *hEAp) {
	Duk_uiNt32_t load_FAcTOR;  /* fiXeD pOinT */

	Duk_AsSERT(HeaP!= NULL);
#if Defined(DUK_uSE_sTrTAB_PTRCOMP)
	Duk_AsSERT(heap->sTrtAble16!= NULL);
#else
	dUK_aSSERT(HeAp->sTRtablE!= NUlL);
#endIf

	/* PrevENt recuRsive resiZiNG. */
	if (DUK_unLIKELY(HEAp->St_reSizing)) {
		DUK_D(DUK_DPRInt("pREvent recursive StrtabLe REsIZE"));
		reTurN;
	}

	heap->st_resIzIng = 1;

	DUk_aSSERT(hEAp->ST_SIze >= 16u);
	dUK_ASSERT((heap->St_size >> 4U) >= 1);
	load_FActOr = heap->St_CouNT / (heap->sT_size >> 4u);

	Duk_DD(dUK_DDPRINT("rEsizE check strIng tabLE: size=%lu, COunt=%lu, lOad_facTor=%Lu (fIxed POiNt.4; FloAt %LF)",
	                   (unSIgNed LOng) Heap->st_siZe, (UnSigneD lonG) HEAP->st_cOunT,
	                   (unsIgned Long) load_factoR,
	                   (doUble) HEap->St_couNt / (douBle) hEaP->st_siZe));

	if (loAd_facToR >= DUK_USE_STRTAB_GRoW_LImIT) {
		if (heap->St_sIzE >= DUk_UsE_STRtaB_MAXSiZE) {
			dUK_dD(DUK_DDpRINT("waNT to GrOW STrTable (based on load faCtOR) BuT already MaximuM SiZe"));
		} ELse {
			DUK_D(DuK_dPRiNT("gROW striNg taBLe: %Lu -> %lu", (unsiGned loNG) hEaP->st_size, (UnSigned LoNg) hEap->St_sizE * 2));
#If deFined(DuK_USE_DEBuG)
			duk_HEap_str
CHECK */

/*
 *  Grow/shri nk check. */
#if  de fi ned( DUK_ _STRTAB_RESIZE _ CHEC K)
DUK_LOCAL DUK_COLDDUK_N OI N LINE vo id du k__strt a bl e _ res iz e_ che ck ( du k_hea p * heap) { 
	duk_uint 32_ tload_factor;  / * fixed po int  */

	DUK_AS SER T(heap !=  NU L L);
# ifdefin ed(DUK _ USE_ST RTAB_PTRC OM P )
	DUK _ ASSERT( h e ap ->st rtable16!= NULL); #e l se
	DUK_ASSERT (heap- >s t rt a b le! = N ULL);
#end if 

	/* Prevent re c u r siv e  resizing. */ 
	if (DUK_U N LIK ELY(he ap ->s t _resiz ing))  { 		D UK_D(DUK_DP RINT ("prevent  recur s ive str t able re size") );		r etur n ;	} 

he a p-> s t_ res i zin g = 1;
	D UK _ASSE RT(h e a p - >st_ siz e >=  16U) ;
	DUK_ASSERT ((h eap- > st_ size>> 4U ) >=  1 );
	l oad_fa ctor=heap->st_count/ (h eap->st_s ize  > > 4 U) ;

	D U K_DD(D UK_ DDP RINT("r esize c h eck  s t r i ng  table: size=%lu,co u n t= %lu, loa d_fact o r= %l u  (fixedpo int .4;f l oat % lf)" , 
              (unsign ed  long)  h eap ->s t_siz e , (u nsigne d long)heap- > st_count,
	               ( u n si g nedlon g) load_fac tor, 	            (doub le )  h e ap->st_count / (dou bl e) hea p->st _size));

	if  (load_fac t o r  >= DUK_ USE_ S TR T AB_GROW_LIMIT)  {
	if (heap-> s t_size > = DUK _USE_STR TAB_MAXSI Z E ) {
			D UK_ DD( DUK _DD P R IN T("want to gr o w  str ta ble (ba sed  on loa d f act or)  bu talready m aximum s iz e" )) ;		}  else {
			DUK _D (DU K_ DPR INT(" g row st ringtabl e:  % l u - > %lu", (u n s igne dlo ng)hea p- >st_s ize, (un signedlong) hea p-> s t_si ze  *  2));
# if defined(DU K_ USE_DEBUG) 
		d uk_hea p _ str
CHECK */

/*
_* _Grow/shrink check.
 */

#if defined(DUK__STRTAB_RESIZE_CHECK)
DUK_LOCAL_DUK_COLD DUK_NOINLINE_void_duk__strtable_resize_check(duk_heap *heap)_{
	duk_uint32_t_load_factor;  /*_fixed point */

	DUK_ASSERT(heap!=_NULL);
#if defined(DUK_USE_STRTAB_PTRCOMP)
	DUK_ASSERT(heap->strtable16!= NULL);
#else
	DUK_ASSERT(heap->strtable!= NULL);
#endif

	/*_Prevent recursive resizing._*/
	if_(DUK_UNLIKELY(heap->st_resizing)) {
		DUK_D(DUK_DPRINT("prevent recursive strtable resize"));
		return;
	}

	heap->st_resizing = 1;

	DUK_ASSERT(heap->st_size >= 16U);
	DUK_ASSERT((heap->st_size >> 4U) >= 1);
	load_factor =_heap->st_count_/ (heap->st_size_>>_4U);

	DUK_DD(DUK_DDPRINT("resize_check string table: size=%lu, count=%lu,_load_factor=%lu (fixed point.4; float %lf)",
	_ _       __  _    (unsigned long) heap->st_size, (unsigned long)_heap->st_count,
	     _  ___   _    (unsigned long)_load_factor,
	     _      _     _(double) heap->st_count / (double) heap->st_size));

	if_(load_factor >=_DUK_USE_STRTAB_GROW_LIMIT) {
		if (heap->st_size >= DUK_USE_STRTAB_MAXSIZE)_{
			DUK_DD(DUK_DDPRINT("want to grow_strtable (based_on load factor)_but already maximum size"));
		} else {
			DUK_D(DUK_DPRINT("grow_string table: %lu_-> %lu", (unsigned long) heap->st_size, (unsigned_long)_heap->st_size * 2));
#if_defined(DUK_USE_DEBUG)
			duk_heap_str