mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Perf: Refine the stat
This commit is contained in:
parent
919107c674
commit
c00d286344
6 changed files with 75 additions and 43 deletions
|
@ -302,6 +302,8 @@ private:
|
|||
public:
|
||||
SrsRtpPacket2();
|
||||
virtual ~SrsRtpPacket2();
|
||||
private:
|
||||
void reuse();
|
||||
public:
|
||||
// Reset the object to reuse it.
|
||||
virtual bool reset();
|
||||
|
@ -356,6 +358,9 @@ public:
|
|||
bool enabled() {
|
||||
return enabled_;
|
||||
}
|
||||
int size() {
|
||||
return (int)cache_objs_.size();
|
||||
}
|
||||
// Try to allocate from cache, create new object if no cache.
|
||||
T* allocate() {
|
||||
while (true) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue