X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=ptable.h;h=c694620cf669a8fe2e8442ebdc4dd39cbb2e71c5;hb=418197898e73f85448f28aa1236f205f6a3cff5d;hp=fc50652443bb58dc8f117ab9b0ca3ec2c2844efe;hpb=b56734d8bae611bf89f0c65a084de7079d119d96;p=perl%2Fmodules%2FLexical-Types.git diff --git a/ptable.h b/ptable.h index fc50652..c694620 100644 --- a/ptable.h +++ b/ptable.h @@ -1,4 +1,4 @@ -/* This file is part of the Lexical-Types Perl module. +/* This file is part of the Lexical::Types Perl module. * See http://search.cpan.org/dist/Lexical-Types/ */ /* This is a pointer table implementation essentially copied from the ptr_table @@ -155,7 +155,7 @@ STATIC void PTABLE_PREFIX(_store)(pPTBL_ ptable * const t, const void * const ke void *oldval = ent->val; PTABLE_VAL_FREE(oldval); ent->val = val; - } else { + } else if (val) { const UV i = PTABLE_HASH(key) & t->max; ent = PerlMemShared_malloc(sizeof *ent); ent->key = key; @@ -212,5 +212,10 @@ STATIC void PTABLE_PREFIX(_free)(pPTBL_ ptable * const t) { PerlMemShared_free(t); } +#undef pPTBL +#undef pPTBL_ +#undef aPTBL +#undef aPTBL_ + #undef PTABLE_NAME #undef PTABLE_VAL_FREE