From 5de45e0dade1b95466c70e2261741d7b298bdc5d Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Mon, 10 Jul 2023 12:39:43 -0700 Subject: [PATCH] Re-gen. --- autosrc/rtpp_refcnt_fin.c | 63 +++++++++++++++++++++++++++++++++++++++ autosrc/rtpp_refcnt_fin.h | 7 +++++ 2 files changed, 70 insertions(+) diff --git a/autosrc/rtpp_refcnt_fin.c b/autosrc/rtpp_refcnt_fin.c index 3bc38728b..baeeec772 100644 --- a/autosrc/rtpp_refcnt_fin.c +++ b/autosrc/rtpp_refcnt_fin.c @@ -44,6 +44,28 @@ static const struct rtpp_refcnt_smethods rtpp_refcnt_smethods_fin = { .traceen = (refcnt_traceen_t)&refcnt_traceen_fin, .use_stdfree = (refcnt_use_stdfree_t)&refcnt_use_stdfree_fin, }; +static void refcnt_fast_attach_fin(void *pub) { + fprintf(stderr, "Method rtpp_refcnt_fast@%p::attach (refcnt_fast_attach) is invoked after destruction\x0a", pub); + RTPP_AUTOTRAP(); +} +static void refcnt_fast_decref_fin(void *pub) { + fprintf(stderr, "Method rtpp_refcnt_fast@%p::decref (refcnt_fast_decref) is invoked after destruction\x0a", pub); + RTPP_AUTOTRAP(); +} +static void refcnt_fast_getdata_fin(void *pub) { + fprintf(stderr, "Method rtpp_refcnt_fast@%p::getdata (refcnt_fast_getdata) is invoked after destruction\x0a", pub); + RTPP_AUTOTRAP(); +} +static void refcnt_fast_incref_fin(void *pub) { + fprintf(stderr, "Method rtpp_refcnt_fast@%p::incref (refcnt_fast_incref) is invoked after destruction\x0a", pub); + RTPP_AUTOTRAP(); +} +static const struct rtpp_refcnt_fast_smethods rtpp_refcnt_fast_smethods_fin = { + .attach = (refcnt_fast_attach_t)&refcnt_fast_attach_fin, + .decref = (refcnt_fast_decref_t)&refcnt_fast_decref_fin, + .getdata = (refcnt_fast_getdata_t)&refcnt_fast_getdata_fin, + .incref = (refcnt_fast_incref_t)&refcnt_fast_incref_fin, +}; void rtpp_refcnt_fin(struct rtpp_refcnt *pub) { RTPP_DBG_ASSERT(pub->smethods->attach != (refcnt_attach_t)NULL); RTPP_DBG_ASSERT(pub->smethods->decref != (refcnt_decref_t)NULL); @@ -56,6 +78,15 @@ void rtpp_refcnt_fin(struct rtpp_refcnt *pub) { pub->smethods != NULL); pub->smethods = &rtpp_refcnt_smethods_fin; } +void rtpp_refcnt_fast_fin(struct rtpp_refcnt_fast *pub) { + RTPP_DBG_ASSERT(pub->smethods->attach != (refcnt_fast_attach_t)NULL); + RTPP_DBG_ASSERT(pub->smethods->decref != (refcnt_fast_decref_t)NULL); + RTPP_DBG_ASSERT(pub->smethods->getdata != (refcnt_fast_getdata_t)NULL); + RTPP_DBG_ASSERT(pub->smethods->incref != (refcnt_fast_incref_t)NULL); + RTPP_DBG_ASSERT(pub->smethods != &rtpp_refcnt_fast_smethods_fin && + pub->smethods != NULL); + pub->smethods = &rtpp_refcnt_fast_smethods_fin; +} #if defined(RTPP_FINTEST) #include #include @@ -102,4 +133,36 @@ rtpp_refcnt_fintest() } const static void *_rtpp_refcnt_ftp = (void *)&rtpp_refcnt_fintest; DATA_SET(rtpp_fintests, _rtpp_refcnt_ftp); +void +rtpp_refcnt_fast_fintest() +{ + int naborts_s; + + struct { + struct rtpp_refcnt_fast pub; + } *tp; + + naborts_s = _naborts; + tp = rtpp_rgmalloc(MLT_RF, MLT_ZR, sizeof(*tp), offsetof(typeof(*tp), pub.rcnt)); + assert(tp != NULL); + assert(tp->pub.rcnt != NULL); + static const struct rtpp_refcnt_fast_smethods dummy = { + .attach = (refcnt_fast_attach_t)((void *)0x1), + .decref = (refcnt_fast_decref_t)((void *)0x1), + .getdata = (refcnt_fast_getdata_t)((void *)0x1), + .incref = (refcnt_fast_incref_t)((void *)0x1), + }; + tp->pub.smethods = &dummy; + CALL_SMETHOD(tp->pub.rcnt, attach, USE_DTOR(rtpp_refcnt_fast_fin, + &tp->pub)); + RTPP_OBJ_DECREF(&(tp->pub)); + CALL_TFIN(&tp->pub, attach); + CALL_TFIN(&tp->pub, decref); + CALL_TFIN(&tp->pub, getdata); + CALL_TFIN(&tp->pub, incref); + assert((_naborts - naborts_s) == 4); + free(tp); +} +const static void *_rtpp_refcnt_fast_ftp = (void *)&rtpp_refcnt_fast_fintest; +DATA_SET(rtpp_fintests, _rtpp_refcnt_fast_ftp); #endif /* RTPP_FINTEST */ diff --git a/autosrc/rtpp_refcnt_fin.h b/autosrc/rtpp_refcnt_fin.h index b4596e081..9de189ea1 100644 --- a/autosrc/rtpp_refcnt_fin.h +++ b/autosrc/rtpp_refcnt_fin.h @@ -12,7 +12,14 @@ void rtpp_refcnt_fin(struct rtpp_refcnt *); #else #define rtpp_refcnt_fin(arg) /* nop */ #endif +#if defined(RTPP_DEBUG) +struct rtpp_refcnt_fast; +void rtpp_refcnt_fast_fin(struct rtpp_refcnt_fast *); +#else +#define rtpp_refcnt_fast_fin(arg) /* nop */ +#endif #if defined(RTPP_FINTEST) void rtpp_refcnt_fintest(void); +void rtpp_refcnt_fast_fintest(void); #endif /* RTPP_FINTEST */ #endif /* _rtpp_refcnt_fin_h */