mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-06-30 12:14:08 +03:00
0023393: Improve usability of OSD_MAllocHook::CollectBySize
Usability of OSD_MAllocHook::CollectBySize was improved: - fields of OSD_MAllocHook::CollectBySize are made public (not private) to enable access for debugging purposes. - added field myMaxAllocSize to denote maximum tracked size
This commit is contained in:
parent
536416f3d2
commit
1cc1abe1ab
@ -452,6 +452,7 @@ OSD_MAllocHook::CollectBySize::~CollectBySize()
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
#define MAX_ALLOC_SIZE 2000000u
|
#define MAX_ALLOC_SIZE 2000000u
|
||||||
|
const size_t OSD_MAllocHook::CollectBySize::myMaxAllocSize = MAX_ALLOC_SIZE;
|
||||||
|
|
||||||
void OSD_MAllocHook::CollectBySize::Reset()
|
void OSD_MAllocHook::CollectBySize::Reset()
|
||||||
{
|
{
|
||||||
|
@ -132,7 +132,7 @@ public:
|
|||||||
Standard_EXPORT virtual void AllocEvent(size_t, long);
|
Standard_EXPORT virtual void AllocEvent(size_t, long);
|
||||||
Standard_EXPORT virtual void FreeEvent(void*, size_t, long);
|
Standard_EXPORT virtual void FreeEvent(void*, size_t, long);
|
||||||
|
|
||||||
private:
|
public:
|
||||||
struct Numbers
|
struct Numbers
|
||||||
{
|
{
|
||||||
int nbAlloc;
|
int nbAlloc;
|
||||||
@ -140,11 +140,13 @@ public:
|
|||||||
int nbLeftPeak;
|
int nbLeftPeak;
|
||||||
Numbers() : nbAlloc(0), nbFree(0), nbLeftPeak(0) {}
|
Numbers() : nbAlloc(0), nbFree(0), nbLeftPeak(0) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const size_t myMaxAllocSize; //!< maximum tracked size
|
||||||
|
|
||||||
Standard_Mutex myMutex;
|
Standard_Mutex myMutex; //!< used for thread-safe access
|
||||||
Numbers* myArray;
|
Numbers* myArray; //!< indexed from 0 to myMaxAllocSize-1
|
||||||
ptrdiff_t myTotalLeftSize;
|
ptrdiff_t myTotalLeftSize; //!< currently remained allocated size
|
||||||
size_t myTotalPeakSize;
|
size_t myTotalPeakSize; //!< maxium cumulative allocated size
|
||||||
size_t myBreakSize;
|
size_t myBreakSize;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user