mirror of https://github.com/FreeRDP/FreeRDP
Added stream pool shrinking if large parts are unused.
This commit is contained in:
parent
33b4407314
commit
fb4fd9f5bb
|
@ -182,6 +182,11 @@ void StreamPool_Return(wStreamPool* pool, wStream* s)
|
|||
pool->aCapacity *= 2;
|
||||
pool->aArray = (wStream**) realloc(pool->aArray, sizeof(wStream*) * pool->aCapacity);
|
||||
}
|
||||
else if ((pool->aSize + 1) * 3 < pool->aCapacity)
|
||||
{
|
||||
pool->aCapacity /= 2;
|
||||
pool->aArray = (wStream**) realloc(pool->aArray, sizeof(wStream*) * pool->aCapacity);
|
||||
}
|
||||
|
||||
pool->aArray[(pool->aSize)++] = s;
|
||||
StreamPool_RemoveUsed(pool, s);
|
||||
|
|
Loading…
Reference in New Issue