/* Fast buffer writer with slack management. Macro support functions (use only macros in calling code)  */
DUK_LOCAL void duk__bw_update_ptrs(duk_hthread *thr, duk_bufwriter_ctx *bw_ctx, duk_size_t curr_offset, duk_size_t new_length)
/* Fast buffer writer with slack management. Macro support functions (use only macros in calling code)  */
DUK_LOCAL void duk__bw_update_ptrs(duk_hthread *thr, duk_bufwriter_ctx *bw_ctx, duk_size_t curr_offset, duk_size_t new_length)
{
	duk_small_int_t npad;
	DUK_ASSERT(ctx != NULL);
	DUK_ASSERT(ctx->currbits < 8);
	npad = (duk_small_int_t) (8 - ctx->currbits);
	if (npad > 0) {
		duk_be_encode(ctx, 0, npad);
	}
	DUK_ASSERT(ctx->currbits == 0);
}