Skip to content

Commit 33e0c10

Browse files
committed
No memset on reset; remove debug loging
1 parent 66e3684 commit 33e0c10

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

include/slick_queue.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ class SlickQueue {
8080
}
8181

8282
if (hMapFile_) {
83-
printf("Destroy MapFile %p\n", hMapFile_);
8483
CloseHandle(hMapFile_);
8584
hMapFile_ = nullptr;
8685
}
@@ -139,12 +138,6 @@ class SlickQueue {
139138
}
140139

141140
void reset() noexcept {
142-
auto next = reserved_->load(std::memory_order_relaxed);
143-
if (next <= mask_) {
144-
// data hasn't wrapped yet, need to invalidate
145-
memset(control_, 0, sizeof(slot) * size_);
146-
memset(data_, 0, sizeof(T) * size_);
147-
}
148141
// invalidate first slot
149142
control_[0].data_index.store(1, std::memory_order_release);
150143
reserved_->store(0, std::memory_order_release);
@@ -196,8 +189,6 @@ class SlickQueue {
196189
if (err != ERROR_ALREADY_EXISTS) {
197190
own_ = true;
198191
}
199-
200-
printf("%s MapFile created %p\n", shm_name, hMapFile);
201192
}
202193

203194
void* lpvMem = MapViewOfFile(hMapFile, FILE_MAP_ALL_ACCESS, 0, 0, BF_SZ);
@@ -211,7 +202,6 @@ class SlickQueue {
211202
*reinterpret_cast<uint32_t*>(reinterpret_cast<uint8_t*>(lpvMem) + sizeof(std::atomic_uint_fast64_t)) = mask_ + 1;
212203
control_ = new ((uint8_t*)lpvMem + 64) slot[size_];
213204
data_ = new ((uint8_t*)lpvMem + 64 + sizeof(slot) * size_) T[size_];
214-
printf("%s shm memory created %p size: %d(%d)\n", shm_name, lpvMem, *reinterpret_cast<uint32_t*>(reinterpret_cast<uint8_t*>(lpvMem) + sizeof(std::atomic_uint_fast64_t)), mask_);
215205
}
216206
else {
217207
reserved_ = reinterpret_cast<std::atomic_uint_fast64_t*>(lpvMem);

0 commit comments

Comments
 (0)