OOM fuzz testing base
This commit is contained in:
parent
1e2b734f5d
commit
8ad7b6149f
@ -10,7 +10,7 @@ B md2BI_ucw(Md2* t, B o, B f, B g, B w, B x) { return ((BMd2*)t)->ucw(t, o, f, g
|
|||||||
B val_c1(Md2D* d, B x) { return c1(d->f, x); }
|
B val_c1(Md2D* d, B x) { return c1(d->f, x); }
|
||||||
B val_c2(Md2D* d, B w, B x) { return c2(d->g, w,x); }
|
B val_c2(Md2D* d, B w, B x) { return c2(d->g, w,x); }
|
||||||
|
|
||||||
#if CATCH_ERRORS
|
#if CATCH_ERRORS && !BI_CATCH_DISABLED
|
||||||
extern B lastErrMsg; // sysfn.c
|
extern B lastErrMsg; // sysfn.c
|
||||||
|
|
||||||
B fillBy_c1(Md2D* d, B x) {
|
B fillBy_c1(Md2D* d, B x) {
|
||||||
|
|||||||
@ -254,7 +254,16 @@ static BBB2B c2fn(B f) {
|
|||||||
extern u32** actrs;
|
extern u32** actrs;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
static inline void onAlloc(usz sz, u8 type) {
|
|
||||||
|
#ifdef OOM_TEST
|
||||||
|
extern i64 oomTestLeft;
|
||||||
|
NOINLINE NORETURN void thrOOMTest(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
FORCE_INLINE void onAlloc(usz sz, u8 type) {
|
||||||
|
#ifdef OOM_TEST
|
||||||
|
if (--oomTestLeft==0) thrOOMTest();
|
||||||
|
#endif
|
||||||
#ifdef ALLOC_STAT
|
#ifdef ALLOC_STAT
|
||||||
if (!ctr_a) {
|
if (!ctr_a) {
|
||||||
#ifdef ALLOC_SIZES
|
#ifdef ALLOC_SIZES
|
||||||
@ -272,7 +281,7 @@ static inline void onAlloc(usz sz, u8 type) {
|
|||||||
talloc+= sz;
|
talloc+= sz;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
static inline void onFree(Value* x) {
|
FORCE_INLINE void onFree(Value* x) {
|
||||||
#ifdef ALLOC_STAT
|
#ifdef ALLOC_STAT
|
||||||
ctr_f[x->type]++;
|
ctr_f[x->type]++;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user