mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 07:37:03 +00:00
[11333] Reserve 9 bytes for PackedGuid buffer instead of 4096 to save RAM.
Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
parent
6f34696350
commit
e84d8fe335
2 changed files with 7 additions and 4 deletions
|
|
@ -201,14 +201,17 @@ class MANGOS_DLL_SPEC ObjectGuid
|
||||||
|
|
||||||
typedef std::set<ObjectGuid> ObjectGuidSet;
|
typedef std::set<ObjectGuid> ObjectGuidSet;
|
||||||
|
|
||||||
|
//minimum buffer size for packed guid is 9 bytes
|
||||||
|
#define PACKED_GUID_MIN_BUFFER_SIZE 9
|
||||||
|
|
||||||
class PackedGuid
|
class PackedGuid
|
||||||
{
|
{
|
||||||
friend ByteBuffer& operator<< (ByteBuffer& buf, PackedGuid const& guid);
|
friend ByteBuffer& operator<< (ByteBuffer& buf, PackedGuid const& guid);
|
||||||
|
|
||||||
public: // constructors
|
public: // constructors
|
||||||
explicit PackedGuid() { m_packedGuid.appendPackGUID(0); }
|
explicit PackedGuid() : m_packedGuid(PACKED_GUID_MIN_BUFFER_SIZE) { m_packedGuid.appendPackGUID(0); }
|
||||||
explicit PackedGuid(uint64 const& guid) { m_packedGuid.appendPackGUID(guid); }
|
explicit PackedGuid(uint64 const& guid) : m_packedGuid(PACKED_GUID_MIN_BUFFER_SIZE) { m_packedGuid.appendPackGUID(guid); }
|
||||||
explicit PackedGuid(ObjectGuid const& guid) { m_packedGuid.appendPackGUID(guid.GetRawValue()); }
|
explicit PackedGuid(ObjectGuid const& guid) : m_packedGuid(PACKED_GUID_MIN_BUFFER_SIZE) { m_packedGuid.appendPackGUID(guid.GetRawValue()); }
|
||||||
|
|
||||||
public: // modifiers
|
public: // modifiers
|
||||||
void Set(uint64 const& guid) { m_packedGuid.wpos(0); m_packedGuid.appendPackGUID(guid); }
|
void Set(uint64 const& guid) { m_packedGuid.wpos(0); m_packedGuid.appendPackGUID(guid); }
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11332"
|
#define REVISION_NR "11333"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue