added a memory management class for small objects.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4046 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2011-02-20 21:36:21 +00:00
parent db19db7e60
commit 827dbd8cf3
8 changed files with 538 additions and 4 deletions

View file

@ -56,6 +56,8 @@
* 8 bits: SubType
******************************************************************/
#include <util/smallobject.h>
const uint8_t RS_PKT_VERSION1 = 0x01;
const uint8_t RS_PKT_VERSION_SERVICE = 0x02;
@ -65,11 +67,15 @@ const uint8_t RS_PKT_CLASS_CONFIG = 0x02;
const uint8_t RS_PKT_SUBTYPE_DEFAULT = 0x01; /* if only one subtype */
class RsItem
class RsItem: public RsMemoryManagement::SmallObject
{
public:
RsItem(uint32_t t);
RsItem(uint8_t ver, uint8_t cls, uint8_t t, uint8_t subtype);
#ifdef DO_STATISTICS
void *operator new(size_t s) ;
void operator delete(void *,size_t s) ;
#endif
virtual ~RsItem();
virtual void clear() = 0;