X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Parameters.xs;h=930011315092b125852fa58ac8b65cef16555ceb;hb=f4c2f0390fe960a1bfff3cff25d12ad3e11fa99a;hp=3a56ff2294d1d9d112e6261e19ffd551536ecea7;hpb=67fc1ddbf6dc7619873577798a5208023f9704bd;p=p5sagit%2FFunction-Parameters.git diff --git a/Parameters.xs b/Parameters.xs index 3a56ff2..9300113 100644 --- a/Parameters.xs +++ b/Parameters.xs @@ -147,39 +147,6 @@ static SV *sentinel_mortalize(Sentinel sen, SV *sv) { return sv; } -static void my_safefree(void *p) { - Safefree(p); -} - -#define SENTINEL_ALLOC(SEN, P, N, T) STMT_START { \ - Newx(P, N, T); \ - sentinel_register(SEN, P, my_safefree); \ -} STMT_END - -#define SENTINEL_MDUP(SEN, P, O, N, T) STMT_START { \ - void *const _sentinel_mdup_tmp_ = (P); \ - SENTINEL_ALLOC(SEN, P, N, T); \ - memcpy(P, _sentinel_mdup_tmp_, O * sizeof (T)); \ -} STMT_END - -#define SENTINEL_REALLOC(SEN, P, N, T) STMT_START { \ - assert((N) > 0); \ - if (!(P)) { \ - SENTINEL_ALLOC(SEN, P, N, T); \ - } else { \ - Resource **_sentinel_realloc_tmp_ = (SEN); \ - for (;;) { \ - assert(*_sentinel_realloc_tmp_ != NULL); \ - if ((*_sentinel_realloc_tmp_)->data == (P)) { \ - Renew((*_sentinel_realloc_tmp_)->data, N, T); \ - (P) = (*_sentinel_realloc_tmp_)->data; \ - break; \ - } \ - _sentinel_realloc_tmp_ = &(*_sentinel_realloc_tmp_)->next; \ - } \ - } \ -} STMT_END - static int kw_flags(pTHX_ Sentinel sen, const char *kw_ptr, STRLEN kw_len, KWSpec *spec) { HV *hints; SV *sv, **psv;