1
0
Fork 0
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:
winlin 2021-02-26 21:35:51 +08:00
parent d6c0117870
commit e79293a3bc
6 changed files with 75 additions and 43 deletions

View file

@ -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) {