1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

For #1509, decrease the fast vector init size from 64KB to 64B. 3.0.99

This commit is contained in:
winlin 2020-01-15 21:26:02 +08:00
parent 857c783efc
commit 7240fe3040
7 changed files with 17 additions and 31 deletions

View file

@ -154,7 +154,7 @@ int64_t SrsRtmpJitter::get_time()
SrsFastVector::SrsFastVector()
{
count = 0;
nb_msgs = SRS_PERF_MW_MSGS * 8;
nb_msgs = 8;
msgs = new SrsSharedPtrMessage*[nb_msgs];
}
@ -212,7 +212,7 @@ void SrsFastVector::push_back(SrsSharedPtrMessage* msg)
{
// increase vector.
if (count >= nb_msgs) {
int size = nb_msgs * 2;
int size = srs_max(SRS_PERF_MW_MSGS * 8, nb_msgs * 2);
SrsSharedPtrMessage** buf = new SrsSharedPtrMessage*[size];
for (int i = 0; i < nb_msgs; i++) {
buf[i] = msgs[i];