Loading include/ByteStream.h +0 −8 Original line number Original line Diff line number Diff line Loading @@ -129,14 +129,6 @@ public: /// Pointer to the stream /// Pointer to the stream byte* stream; byte* stream; static dword count_object; static dword count_object2; static dword count_object_deleted; static dword count_object_deleted2; protected: protected: /// Internal use only for memory management /// Internal use only for memory management Loading src/ByteStream.cpp +1 −51 Original line number Original line Diff line number Diff line Loading @@ -21,14 +21,6 @@ #include "Utility.h" #include "Utility.h" using namespace PacketLib; using namespace PacketLib; /// Objects that deallocate memory dword ByteStream::count_object = 0; /// Objects that do not deallocate memory dword ByteStream::count_object2 = 0; dword ByteStream::count_object_deleted = 0; dword ByteStream::count_object_deleted2 = 0; /// Returns a pointer of a field in the list of fields of this part of packet. /// Returns a pointer of a field in the list of fields of this part of packet. /// \remarks mem_allocation = true indicates that the allocated memory must be released by the destroyer. /// \remarks mem_allocation = true indicates that the allocated memory must be released by the destroyer. /// \remarks memory_sharing=false In all methods of constructor or set type accepting byte*, it indicates that the swap is applied. /// \remarks memory_sharing=false In all methods of constructor or set type accepting byte*, it indicates that the swap is applied. Loading Loading @@ -137,15 +129,9 @@ PacketLib::ByteStream::~ByteStream() { { if(mem_allocation) if(mem_allocation) { { ByteStream::count_object_deleted++; //cout << "ByteStream::~ByteStream() delete[] stream;" << endl; delete[] stream; delete[] stream; stream = 0; stream = 0; } } else ; // ByteStream::count_object_deleted2++; //cout << "ByteStream::~ByteStream()" << endl; } } Loading Loading @@ -382,46 +368,10 @@ void PacketLib::ByteStream::swapWordIfStreamIsBigEndian() } } } } void PacketLib::ByteStream::setMemoryAllocated(bool allocated) void PacketLib::ByteStream::setMemoryAllocated(bool allocated) { { if(allocated) { if(mem_allocation_constructor) { ByteStream::count_object ++; } else { if(mem_allocation == false) { ByteStream::count_object2 --; ByteStream::count_object ++; } } mem_allocation = allocated; } else { if(mem_allocation_constructor) { ByteStream::count_object2 ++; } else { if(mem_allocation == true) { ByteStream::count_object --; ByteStream::count_object2 ++; } } mem_allocation = allocated; mem_allocation = allocated; } } } void PacketLib::ByteStream::deleteStreamMemory() void PacketLib::ByteStream::deleteStreamMemory() { { Loading Loading
include/ByteStream.h +0 −8 Original line number Original line Diff line number Diff line Loading @@ -129,14 +129,6 @@ public: /// Pointer to the stream /// Pointer to the stream byte* stream; byte* stream; static dword count_object; static dword count_object2; static dword count_object_deleted; static dword count_object_deleted2; protected: protected: /// Internal use only for memory management /// Internal use only for memory management Loading
src/ByteStream.cpp +1 −51 Original line number Original line Diff line number Diff line Loading @@ -21,14 +21,6 @@ #include "Utility.h" #include "Utility.h" using namespace PacketLib; using namespace PacketLib; /// Objects that deallocate memory dword ByteStream::count_object = 0; /// Objects that do not deallocate memory dword ByteStream::count_object2 = 0; dword ByteStream::count_object_deleted = 0; dword ByteStream::count_object_deleted2 = 0; /// Returns a pointer of a field in the list of fields of this part of packet. /// Returns a pointer of a field in the list of fields of this part of packet. /// \remarks mem_allocation = true indicates that the allocated memory must be released by the destroyer. /// \remarks mem_allocation = true indicates that the allocated memory must be released by the destroyer. /// \remarks memory_sharing=false In all methods of constructor or set type accepting byte*, it indicates that the swap is applied. /// \remarks memory_sharing=false In all methods of constructor or set type accepting byte*, it indicates that the swap is applied. Loading Loading @@ -137,15 +129,9 @@ PacketLib::ByteStream::~ByteStream() { { if(mem_allocation) if(mem_allocation) { { ByteStream::count_object_deleted++; //cout << "ByteStream::~ByteStream() delete[] stream;" << endl; delete[] stream; delete[] stream; stream = 0; stream = 0; } } else ; // ByteStream::count_object_deleted2++; //cout << "ByteStream::~ByteStream()" << endl; } } Loading Loading @@ -382,46 +368,10 @@ void PacketLib::ByteStream::swapWordIfStreamIsBigEndian() } } } } void PacketLib::ByteStream::setMemoryAllocated(bool allocated) void PacketLib::ByteStream::setMemoryAllocated(bool allocated) { { if(allocated) { if(mem_allocation_constructor) { ByteStream::count_object ++; } else { if(mem_allocation == false) { ByteStream::count_object2 --; ByteStream::count_object ++; } } mem_allocation = allocated; } else { if(mem_allocation_constructor) { ByteStream::count_object2 ++; } else { if(mem_allocation == true) { ByteStream::count_object --; ByteStream::count_object2 ++; } } mem_allocation = allocated; mem_allocation = allocated; } } } void PacketLib::ByteStream::deleteStreamMemory() void PacketLib::ByteStream::deleteStreamMemory() { { Loading