[PATCH 05/13] msvcp90: Add implementation of _Concurrent_vector_Internal_clear.

Hua Meng 161220092 at smail.nju.edu.cn
Tue Jul 31 04:42:09 CDT 2018


Signed-off-by: Hua meng <161220092 at smail.nju.edu.cn>
---
 dlls/msvcp90/misc.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/dlls/msvcp90/misc.c b/dlls/msvcp90/misc.c
index d629648579..c3928099a3 100644
--- a/dlls/msvcp90/misc.c
+++ b/dlls/msvcp90/misc.c
@@ -1818,8 +1818,22 @@ DEFINE_THISCALL_WRAPPER(_Concurrent_vector_base_v4__Internal_clear, 8)
 MSVCP_size_t __thiscall _Concurrent_vector_base_v4__Internal_clear(
         _Concurrent_vector_base_v4 *this, void (__cdecl *clear)(void*, MSVCP_size_t))
 {
-    FIXME("(%p %p) stub\n", this, clear);
-    return 0;
+    MSVCP_size_t seg_no, elems;
+    int i;
+
+    TRACE("(%p %p)\n", this, clear);
+
+    seg_no = this->early_size  ? _vector_base_v4__Segment_index_of(this->early_size) + 1 : 0;
+    for(i = seg_no - 1; i >= 0; i--) {
+        elems = this->early_size - (1 << i & ~1);
+        clear(this->segment[i], elems);
+        this->early_size -= elems;
+    }
+    while(seg_no < (this->segment == this->storage ? STORAGE_SIZE : SEGMENT_SIZE)) {
+        if(!this->segment[seg_no]) break;
+        seg_no++;
+    }
+    return seg_no;
 }
 
 /* ?_Internal_compact at _Concurrent_vector_base_v4@details at Concurrency@@IAEPAXIPAXP6AX0I at ZP6AX0PBXI@Z at Z */
-- 
2.11.0







More information about the wine-devel mailing list