bug 1239: Add assertion that reference count never overflows

This commit is contained in:
Mathieu Lacage
2011-08-10 13:14:42 -04:00
parent 332604fd02
commit a59bdc3a30

View File

@@ -24,7 +24,9 @@
#include "empty.h"
#include "default-deleter.h"
#include "assert.h"
#include <stdint.h>
#include <limits>
namespace ns3 {
@@ -79,6 +81,7 @@ public:
*/
inline void Ref (void) const
{
NS_ASSERT (m_count < std::numeric_limits<uint32_t>::max());
m_count++;
}
/**