Skip to content

Commit

Permalink
Re-gen.
Browse files Browse the repository at this point in the history
  • Loading branch information
sobomax committed Jul 10, 2023
1 parent 6b0685e commit 5de45e0
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
63 changes: 63 additions & 0 deletions autosrc/rtpp_refcnt_fin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 <assert.h>
#include <stddef.h>
Expand Down Expand Up @@ -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 */
7 changes: 7 additions & 0 deletions autosrc/rtpp_refcnt_fin.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit 5de45e0

Please sign in to comment.