mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 17:04:24 +09:00
Added stream pool shrinking if large parts are unused.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user