From bd887b660d9bcbdb6dd3458223331eea8dcdc654 Mon Sep 17 00:00:00 2001 From: gfx Date: Thu, 16 Sep 2010 20:31:34 +0900 Subject: [PATCH] Preallocate hv keys --- perl/xs-src/unpack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/perl/xs-src/unpack.c b/perl/xs-src/unpack.c index a429ecd9..1d7de711 100644 --- a/perl/xs-src/unpack.c +++ b/perl/xs-src/unpack.c @@ -157,10 +157,11 @@ STATIC_INLINE int template_callback_array_item(unpack_user* u PERL_UNUSED_DECL, return 0; } -STATIC_INLINE int template_callback_map(unpack_user* u PERL_UNUSED_DECL, unsigned int n PERL_UNUSED_DECL, SV** o) +STATIC_INLINE int template_callback_map(unpack_user* u PERL_UNUSED_DECL, unsigned int n, SV** o) { dTHX; HV* const h = newHV(); + hv_ksplit(h, n); *o = newRV_noinc((SV*)h); return 0; }