X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Parameters.xs;fp=Parameters.xs;h=f2ac0da14383b429e13561a64a25d89f79d9ff85;hb=f6e49471e0be9393fd3d30e1c49b9e9ff9e8ee67;hp=261cbdbc476680a105ecea6737d0f26908cd974e;hpb=79bce2d4a17a645d7cd4c90e8b9e8e9d73804064;p=p5sagit%2FFunction-Parameters.git diff --git a/Parameters.xs b/Parameters.xs index 261cbdb..f2ac0da 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;