From e3389187734a7e338df15de0f194edc881584c52 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Mon, 20 Nov 2006 12:57:49 +0100 Subject: [PATCH] Disable new/delete for bele policies. --- src/bele_policy.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/bele_policy.h b/src/bele_policy.h index b7375e9e..ebb06071 100644 --- a/src/bele_policy.h +++ b/src/bele_policy.h @@ -53,7 +53,7 @@ #if defined(BELE_RTP) struct AbstractPolicy { - AbstractPolicy() {} + explicit AbstractPolicy() {} virtual inline ~AbstractPolicy() {} V bool isBE() C = 0; V bool isLE() C = 0; @@ -82,6 +82,9 @@ struct AbstractPolicy S u24_compare_signed(const void *a, const void *b) C = 0; S u32_compare_signed(const void *a, const void *b) C = 0; S u64_compare_signed(const void *a, const void *b) C = 0; + + // disable dynamic allocation + DISABLE_NEW_DELETE }; #endif @@ -91,7 +94,7 @@ struct BEPolicy : public AbstractPolicy #endif { - BEPolicy() {} + explicit BEPolicy() {} #if defined(BELE_CTP) typedef N_BELE_RTP::BEPolicy RTP_Policy; enum { isBE = 1, isLE = 0 }; @@ -158,6 +161,9 @@ struct BEPolicy COMPILE_TIME_ASSERT_ALIGNOF(U32, char) COMPILE_TIME_ASSERT_ALIGNOF(U64, char) } + + // disable dynamic allocation + DISABLE_NEW_DELETE }; @@ -166,7 +172,7 @@ struct LEPolicy : public AbstractPolicy #endif { - LEPolicy() {} + explicit LEPolicy() {} #if defined(BELE_CTP) typedef N_BELE_RTP::LEPolicy RTP_Policy; enum { isBE = 0, isLE = 1 }; @@ -233,6 +239,9 @@ struct LEPolicy COMPILE_TIME_ASSERT_ALIGNOF(U32, char) COMPILE_TIME_ASSERT_ALIGNOF(U64, char) } + + // disable dynamic allocation + DISABLE_NEW_DELETE };