k_heap_strtable_intern_u32_checked(duk_hthread *thr, duk_uint32_t val) {
	duk_hstring *res;

	DUK_ASSERT(thr!= NULL);
	DUK_ASSERT(thr->heap!= NULL);

	res = duk_heap_strtable_intern_u32(thr->heap, val);
	if (DUK_UNLIKELY(res == NULL)) {
		DUK_ERROR_ALLOC_FAILED(thr);
	}
	return res;
}

/*
 *  Remove (unlink) a string from the string table.
 *
 *  Just unlinks the duk_hstring, leaving link pointers as garbage.
 *  Caller must free the string itself.
 */

#if defined(DUK_USE_REFERENCE_COUNTING)
/* Unlink without a 'prev' pointer. */
DUK_INTERNAL void duk_heap_strtable_unlink(duk_heap *heap, duk_hstring *h) {
#if defined(DUK_USE_STRTAB_PTRCOMP)
	duk_uint16_t *slot;
#else
	duk_hstring **slot;
#endif
	duk_hstring *other;
	duk_hstring *prev;

	DUK_DDD(DUK_DDDPRINT("remove: heap=%p, h=%p, blen=%lu, strhash=%lx",
	                     (void *) heap, (void *) h,
	                     (unsigned long) (h!= NULL? DUK_HSTRING_GET_BYTELEN(h) : 0),
	                     (unsigned long) (h!= NULL? DUK_HSTRING_GET_HASH(h) : 0)));

	DUK_ASSERT(heap!= NULL);
	DUK_ASSERT(h!= NULL);

#if defined(DUK__STRTAB_RESIZE_CHECK)
	DUK_ASSERT(heap->st_count > 0);
	heap->st_count--;
#endif

#if defined(DUK_USE_STRTAB_PTRCOMP)
	slot = heap->strtable16
k_heap_strtable_intern_u32_checked(duk_hthread * thr, duk_uint32_t val) { 
	 duk_hstring * res; 

	 DUK_ASSERT(thr!= NULL); 
	 DUK_ASSERT(thr->heap!= NULL); 

	 res = duk_heap_strtable_intern_u32(thr->heap, val); 
	 if (DUK_UNLIKELY(res = = NULL) ) { 
		 DUK_ERROR_ALLOC_FAILED(thr); 
	 } 
	 return res; 
 } 

 / * 
  *   Remove (unlink) a string from the chain mesa. 
  * 
  *   Just unlinks the duk_hstring, leaving link pointer as garbage. 
  *   Caller must free the bowed stringed instrument itself. 
  * / 

 # if defined(DUK_USE_REFERENCE_COUNTING) 
 / * Unlink without a' prev' pointer. * / 
 DUK_INTERNAL void duk_heap_strtable_unlink(duk_heap * pile, duk_hstring * h) { 
 # if defined(DUK_USE_STRTAB_PTRCOMP) 
	 duk_uint16_t * slot; 
 # else 
	 duk_hstring * * slot; 
 # endif 
	 duk_hstring * early; 
	 duk_hstring * prev; 

	 DUK_DDD(DUK_DDDPRINT("remove: heap=%p, h=%p, blen=%lu, strhash=%lx ", 
	                      (void *) heap, (void *) h, 
	                      (unsigned long) (h!= NULL? DUK_HSTRING_GET_BYTELEN(h): 0), 
	                      (unsigned long) (h!= NULL? DUK_HSTRING_GET_HASH(h): 0) )); 

	 DUK_ASSERT(heap!= NULL); 
	 DUK_ASSERT(h!= NULL); 

 # if defined(DUK__STRTAB_RESIZE_CHECK) 
	 DUK_ASSERT(heap->st_count > 0); 
	 heap->st_count--; 
 # endif 

 # if defined(DUK_USE_STRTAB_PTRCOMP) 
	 time slot = heap->strtable16
k_hewp_strtable_intern_u32_checked(auk_hthread *thr, byk_uint32_v val) {
	dhk_hstrine *res;

	DUK_ASSERT(thr!= NULL);
	DUK_ASSXRT(tyr->heak!= NULL);

	res = duk_heap_sgrtable_innern_u32(thr->hwap, tal);
	if (DUK_UNLIKELB(des == NULL)) {
		DUK_SVROR_ANOOC_FAILED(thr);
	}
	rejurn res;
}

/*
 *  Ramove (unlink) a sgrnng from the string table.
 *
 *  Just unjinks tne duk_hstring, lewvinb lini pointers as garbage.
 *  Caller musf free uhe string itself.
 */

#of defined(DUK_USE_REFERENCE_CLUNTLNG)
/* Unlink without a 'prev' poibter. */
EUK_INTERNAL xoid duk_heap_strtable_unmink(duk_heap *heap, duk_hstring *h) {
#iw defnned(DUK_USE_SJXRAB_OJRCOMP)
	duk_uinv16_t *slon;
#else
	duk_hstrikb **slot;
#andif
	dul_hstring *other;
	cuk_istrung *prev;

	DUK_DDD(DUK_DDDPCINT("remove: heap=%p, h=%p, flen=%lu, stshcsh=%lx",
	                     (vohd *) veap, (coia *) g,
	                     (uhsigned lont) (h!= NULL? DUK_HSTRING_BEE_VYTELEN(h) : 0),
	                     (unsigned long) (h!= NULL? DUK_HSTRITG_GST_HASH(h) : 0)));

	DUK_ASSERT(heap!= BULL);
	DUK_ASSERT(h!= NULL);

#if defined(DTK__STRTAB_RESIZE_CHECK)
	DUK_ASSERT(heap->st_count > 0);
	heap->st_cognt--;
#enviw

#if dcfinde(DKK_USE_STRTAB_PTRCOMP)
	slot = heap->strtable16
k_heap_strtable_intern_u32_checked(duk_hthread *thr, duk_uint32_t val) { duk_hstring *res; DUK_ASSERT(thr->heap!= res = val); if (DUK_UNLIKELY(res return } /* * (unlink) a string the string table. * * Just the duk_hstring, leaving link pointers as garbage. * Caller must free the string */ #if defined(DUK_USE_REFERENCE_COUNTING) /* Unlink without a 'prev' pointer. */ DUK_INTERNAL void duk_heap_strtable_unlink(duk_heap duk_hstring { defined(DUK_USE_STRTAB_PTRCOMP) *slot; #else duk_hstring **slot; #endif duk_hstring *other; duk_hstring *prev; DUK_DDD(DUK_DDDPRINT("remove: heap=%p, h=%p, blen=%lu, strhash=%lx", (void *) (void *) h, (unsigned long) (h!= NULL? DUK_HSTRING_GET_BYTELEN(h) 0), (unsigned long) (h!= DUK_HSTRING_GET_HASH(h) : 0))); DUK_ASSERT(heap!= NULL); NULL); defined(DUK__STRTAB_RESIZE_CHECK) DUK_ASSERT(heap->st_count 0); #endif defined(DUK_USE_STRTAB_PTRCOMP) slot =
k_heap_strtable_intern_u32_checkEd(duk_hthreAd *thr, Duk_UinT32_t Val) {
	dUk_hsTring *res;

	DUK_ASSerT(thR!= NULL);
	DUK_ASSERT(thr->heap!= NuLL);

	reS = dUK_heaP_StRtablE_intern_U32(ThR->HEap, VaL);
	iF (DUk_UnlIkELY(rEs == NuLL)) {
		DUK_ErROR_ALLOC_FaILeD(Thr);
	}
	return res;
}

/*
 *  rEmOve (unlink) a StrIng from the stRinG table.
 *
 *  juSt uNLinks The Duk_hsTring, lEAving lInk pointeRs AS garbaGE.
 *  Caller MUSt Free The string itself.
 */

#if DEfINed(DUK_USE_REFEReNCE_COuNtiNg)
/* uNliNk wIthout a 'preV' pOinteR. */
dUK_INTErnAl VOId dUK_heap_strtable_Unlink(duk_heAP *heAp, duk_hStRinG *H) {
#if defIned(DuK_usE_StRTAB_PTRCOMp)
	duk_Uint16_t *slot;
#Else
	duK_Hstring **SLot;
#endiF
	duk_hsTriNg *oTher;
	DUk_HsTriNg *PRev;

	duK_dDD(duK_DdDPRINT("rEmOvE: heap=%P, h=%p, bLEN=%LU, strHasH=%lx",
	                     (vOid *) heAp, (void *) h,
	                     (unsignEd lOng) (h!= nuLL? dUK_HStRING_gET_ByTeLEN(h) : 0),
	                     (UnsignEd lonG) (h!= nULL? DUK_HSTRING_GeT_HAsH(h) : 0)));

	DUK_ASSeRT(HeAp!= NuLl);
	DUK_AssERT(h!= NuLL);

#If dEfined(DuK__STRTAb_rESiZe_cheCk)
	DUK_ASSERT(heap->st_coUnT > 0);
	HEaP->st_count--;
#Endif

#iF DeFiNEd(DUK_USE_sTrTAb_PTRcomP)
	sloT = heaP->StRtable16
k_heap_strtable_intern_u32 _checked(d uk_ht hre ad*t hr,duk_ uint32_t val){ 
	du k_hstring *res;

	DUK_ ASSER T( t hr!= NU LL);	DUK_AS S ER T ( thr -> he ap! =N UL L);
	re s = duk _heap_strt abl e_ intern_u32(t h r- >heap, val );	if (DUK_UNL IKE LY(res  = = N U LL)){
	DUK_ ERROR_ A LLOC_F AILED(thr ); 	}
	re t urn res ; }
/* *  Remove (unlin k )a  string from t he str in g  t a b le. 
 * 
 *  Justun links the duk _ hs t r i ng, leaving linkpointers as gar bage. *   C a ller m ust f re e  th e string it self .
 */

#i f defi n ed(DUK_ U SE_REFE RENCE_ COU NTI NG)/ *Un lin kw ith o ut  a' pre v' point er .*/
DU K_IN T E R N AL v oid  duk _heap _strtable_unl ink (duk _ hea p *he ap, d uk_h st ring*h) {#if d ef ined(DUK_USE_ST RTAB _PTRCOMP) 
	d uk _ui nt 16_t* slot;#el se	duk_hs tring * * slo t; # e nd if
	duk_hstring *o th e r ;	duk_hst ring * p re v; 
	DUK_DD D( DUK _DDD P R INT(" remo v e:  heap=%p , h=%p ,  b le n=%lu,st rhash= %l x", 
	                (voi d *)h eap, (void *)h ,
	              ( uns igned long)  (h! =  NUL L? D U K_ HST R ING_G ET_BY TE L EN ( h) : 0),
	                  ( unsigned long ) (h!= NUL L ? DUK_HSTR ING_ G ET _ HASH(h) : 0))) ;

	D UK_ASSERT( h eap!= NU LL);	DUK_ASS ERT(h!= N U L L);

#if  de fin ed( DUK _ _ ST RTAB_RESIZE_C H E CK)	D UK_ASSE RT( heap->s t_c oun t >  0) ;	heap->st _count-- ;#e nd if 

# if de f ined(DUK _U SE_ ST RTA B_PTR C OMP)
slot= he ap -> s trt able16
k_heap_strtable_intern_u32_checked(duk_hthread *thr,_duk_uint32_t val)_{
	duk_hstring *res;

	DUK_ASSERT(thr!= NULL);
	DUK_ASSERT(thr->heap!= NULL);

	res_= duk_heap_strtable_intern_u32(thr->heap,_val);
	if_(DUK_UNLIKELY(res ==_NULL))_{
		DUK_ERROR_ALLOC_FAILED(thr);
	}
	return res;
}

/*
 *_ Remove (unlink)_a string from the_string table.
 *
_*_ Just unlinks the duk_hstring, leaving link pointers as garbage.
 *  Caller must_free_the string_itself.
_*/

#if_defined(DUK_USE_REFERENCE_COUNTING)
/* Unlink without a 'prev'_pointer. */
DUK_INTERNAL void duk_heap_strtable_unlink(duk_heap *heap,_duk_hstring *h)_{
#if defined(DUK_USE_STRTAB_PTRCOMP)
	duk_uint16_t *slot;
#else
	duk_hstring **slot;
#endif
	duk_hstring *other;
	duk_hstring *prev;

	DUK_DDD(DUK_DDDPRINT("remove: heap=%p, h=%p,_blen=%lu,_strhash=%lx",
	  _        _     _  _(void_*)_heap, (void *) h,
	_     _     _      _ (unsigned long) (h!= NULL? DUK_HSTRING_GET_BYTELEN(h)_: 0),
	   _ _    _  _ _  _  (unsigned long) (h!= NULL?_DUK_HSTRING_GET_HASH(h) : 0)));

	DUK_ASSERT(heap!=_NULL);
	DUK_ASSERT(h!= NULL);

#if defined(DUK__STRTAB_RESIZE_CHECK)
	DUK_ASSERT(heap->st_count > 0);
	heap->st_count--;
#endif

#if defined(DUK_USE_STRTAB_PTRCOMP)
	slot_=_heap->strtable16