[PATCH v2 0/2] MR10789: msvcp120: Ensure that segments are not being allocated when segments table is enlarged.
-- v2: msvcp120: Don't count segments being allocated when reporting vector capacity. https://gitlab.winehq.org/wine/wine/-/merge_requests/10789
From: Piotr Caban <piotr@codeweavers.com> --- dlls/msvcp90/details.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/msvcp90/details.c b/dlls/msvcp90/details.c index 9e541e25213..d6b72fcd3f1 100644 --- a/dlls/msvcp90/details.c +++ b/dlls/msvcp90/details.c @@ -568,7 +568,7 @@ void __thiscall _Concurrent_vector_base_v4__Internal_reserve( InterlockedCompareExchangeSizeT(&this->first_block, block_idx + 1, 0); i = _vector_base_v4__Segment_index_of(capacity); if(this->storage == this->segment) { - for(; i <= block_idx && i < STORAGE_SIZE; i++) + for(i = 0; i <= block_idx && i < STORAGE_SIZE; i++) concurrent_vector_alloc_segment(this, i, element_size); if(block_idx >= STORAGE_SIZE) { new_segment = malloc(SEGMENT_SIZE * sizeof(void*)); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10789
From: Piotr Caban <piotr@codeweavers.com> --- dlls/msvcp90/details.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/msvcp90/details.c b/dlls/msvcp90/details.c index d6b72fcd3f1..a625266e255 100644 --- a/dlls/msvcp90/details.c +++ b/dlls/msvcp90/details.c @@ -541,7 +541,7 @@ size_t __thiscall _Concurrent_vector_base_v4__Internal_capacity( last_block = (this->segment == this->storage ? STORAGE_SIZE : SEGMENT_SIZE); for(i = 0; i < last_block; i++) { - if(!this->segment[i]) + if(!this->segment[i] || this->segment[i] == SEGMENT_ALLOC_MARKER) return !i ? 0 : 1 << i; } return 1 << i; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10789
participants (2)
-
Piotr Caban -
Piotr Caban (@piotr)