ClickHouse-Encoder

 view release on metacpan or  search on metacpan

t/buffer-grow.t  view on Meta::CPAN

#!/usr/bin/env perl
# Force the internal Buffer to grow several times during a single
# encode and verify the final wire bytes match a one-shot encode of
# the same input. Catches realloc bugs in buf_grow (e.g. a stale
# buf->ptr after SvGROW relocates the SV body).
#
# The buffer starts at 256 bytes (see buf_init). Encoding ~10 MiB of
# data forces ~16 doublings (256 -> 512 -> ... -> 16 MiB). Doing it
# both in one shot and chunked via the streamer (which calls do_encode
# repeatedly with fresh buffers) cross-validates that buf_grow's
# pointer refresh is correct and that mortal-buffer cleanup between
# blocks doesn't leak or corrupt state.

use strict;
use warnings;



( run in 0.630 second using v1.01-cache-2.11-cpan-71847e10f99 )