msvcp90: Add implementation of _Concurrent_vector_Internal_capacity.

Signed-off-by: Hua Meng <161220092@smail.nju.edu.cn>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hua Meng 2018-08-02 23:37:32 +08:00 committed by Alexandre Julliard
parent 989aa095fd
commit 58f43430c9
1 changed files with 15 additions and 2 deletions

View File

@ -1780,6 +1780,9 @@ typedef struct __Concurrent_vector_base_v4
void **segment;
} _Concurrent_vector_base_v4;
#define STORAGE_SIZE (sizeof(this->storage) / sizeof(this->storage[0]))
#define SEGMENT_SIZE (sizeof(void*) * 8)
/* ??1_Concurrent_vector_base_v4@details@Concurrency@@IAE@XZ */
/* ??1_Concurrent_vector_base_v4@details@Concurrency@@IEAA@XZ */
DEFINE_THISCALL_WRAPPER(_Concurrent_vector_base_v4_dtor, 4)
@ -1810,8 +1813,18 @@ DEFINE_THISCALL_WRAPPER(_Concurrent_vector_base_v4__Internal_capacity, 4)
MSVCP_size_t __thiscall _Concurrent_vector_base_v4__Internal_capacity(
const _Concurrent_vector_base_v4 *this)
{
FIXME("(%p) stub\n", this);
return 0;
MSVCP_size_t last_block;
int i;
TRACE("(%p)\n", this);
last_block = (this->segment == this->storage ? STORAGE_SIZE : SEGMENT_SIZE);
for(i = 0; i < last_block; i++)
{
if(!this->segment[i])
return !i ? 0 : 1 << i;
}
return 1 << i;
}
/* ?_Internal_clear@_Concurrent_vector_base_v4@details@Concurrency@@IAEIP6AXPAXI@Z@Z */