[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    [PATCH 05/13 v2] msvcp90: Add implementation of _Concurrent_vector_Internal_clear.
From:       Hua Meng <161220092 () smail ! nju ! edu ! cn>
Date:       2018-07-31 15:17:04
Message-ID: 9c276af9-fd46-9219-7d7f-0ad607287ad9 () smail ! nju ! edu ! cn+FC5C7A12557F6961
[Download RAW message or body]

Signed-off-by: Hua meng <161220092@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 34a30cf5e1..a2baf12567 100644
--- a/dlls/msvcp90/misc.c
+++ b/dlls/msvcp90/misc.c
@@ -1987,8 +1987,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@_Concurrent_vector_base_v4@details@Concurrency@@IAEPAXIPAXP6AX0I@ZP6AX0PBXI@Z@Z */
-- 
2.11.0







[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic