mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-19 13:15:00 -04:00
percent_used to fraction_used
This commit is contained in:
parent
7946536511
commit
53a3c76a2a
@ -110,7 +110,7 @@ allocate() {
|
|||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function:
|
// Function: free
|
||||||
// Access:
|
// Access:
|
||||||
// Description: Free an allocated index (index must be between _min
|
// Description: Free an allocated index (index must be between _min
|
||||||
// and _max that were passed to the constructor).
|
// and _max that were passed to the constructor).
|
||||||
@ -134,19 +134,19 @@ free(U32 index) {
|
|||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function:
|
// Function: fraction_used
|
||||||
// Access:
|
// Access:
|
||||||
// Description: return what percentage of the pool is used. The
|
// Description: return the decimal fraction of the pool that is used.
|
||||||
// range is 0 to 1.0, so 75% would be 0.75, for example.
|
// The range is 0 to 1.0 (e.g. 75% would be 0.75).
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
float UniqueIdAllocator::
|
float UniqueIdAllocator::
|
||||||
percent_used() const {
|
fraction_used() const {
|
||||||
return float(_size-_free)/_size;
|
return float(_size-_free)/_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function:
|
// Function: output
|
||||||
// Access:
|
// Access:
|
||||||
// Description: ...intended for debugging only.
|
// Description: ...intended for debugging only.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
@ -53,7 +53,7 @@ PUBLISHED:
|
|||||||
~UniqueIdAllocator();
|
~UniqueIdAllocator();
|
||||||
U32 allocate();
|
U32 allocate();
|
||||||
void free(U32 index);
|
void free(U32 index);
|
||||||
float percent_used() const;
|
float fraction_used() const;
|
||||||
void output(ostream& os, bool verbose=false) const;
|
void output(ostream& os, bool verbose=false) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user