X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=blobdiff_plain;f=ptable.h;h=ba275bac8c717523f844034a31336d817820aaaa;hp=92d1a04cff5175c21cc34178df3714984197d325;hb=8291ef989ac98ee2cb53a6098eed7aa7c3ed0ca8;hpb=93dd6e5ecfa09f52a9aa17909df51d09a0a0a6ff diff --git a/ptable.h b/ptable.h index 92d1a04..ba275ba 100644 --- a/ptable.h +++ b/ptable.h @@ -117,6 +117,16 @@ STATIC void *ptable_fetch(const ptable * const t, const void * const key) { } #endif /* !ptable_fetch */ +STATIC void PTABLE_PREFIX(_delete)(pPTBL_ const ptable * const t, const void * const key) { + ptable_ent *const ent = ptable_find(t, key); + + if (ent) { + void *val = ent->val; + PTABLE_VAL_FREE(val); + ent->val = NULL; + } +} + #ifndef ptable_split STATIC void ptable_split(pPTBLMS_ ptable * const t) { #define ptable_split(T) ptable_split(aPTBLMS_ (T))