Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit 44df169

Browse files
zhaoguoquan94poojanilangekar
authored andcommitted
remove old fix size array
1 parent 67e0fe0 commit 44df169

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

src/common/container/lock_free_array.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class IndirectionArray;
3232
LOCK_FREE_ARRAY_TEMPLATE_ARGUMENTS
3333
LOCK_FREE_ARRAY_TYPE::LockFreeArray(){
3434
new_lock_free_array.clear();
35-
lock_free_array.reset(new lock_free_array_t());
3635
}
3736

3837
LOCK_FREE_ARRAY_TEMPLATE_ARGUMENTS
@@ -44,7 +43,6 @@ LOCK_FREE_ARRAY_TEMPLATE_ARGUMENTS
4443
bool LOCK_FREE_ARRAY_TYPE::Update(const std::size_t &offset, ValueType value){
4544
PL_ASSERT(offset <= LOCK_FREE_ARRAY_MAX_SIZE);
4645
LOG_TRACE("Update at %lu", lock_free_array_offset.load());
47-
lock_free_array->at(offset) = value;
4846
if (new_lock_free_array.size() < offset + 1) {
4947
new_lock_free_array.resize(LOCK_FREE_ARRAY_MAX_SIZE);
5048
}
@@ -55,7 +53,6 @@ bool LOCK_FREE_ARRAY_TYPE::Update(const std::size_t &offset, ValueType value){
5553
LOCK_FREE_ARRAY_TEMPLATE_ARGUMENTS
5654
bool LOCK_FREE_ARRAY_TYPE::Append(ValueType value){
5755
LOG_TRACE("Appended at %lu", lock_free_array_offset.load());
58-
lock_free_array->at(lock_free_array_offset++) = value;
5956
new_lock_free_array.push_back(value);
6057
return true;
6158
}
@@ -64,7 +61,6 @@ LOCK_FREE_ARRAY_TEMPLATE_ARGUMENTS
6461
bool LOCK_FREE_ARRAY_TYPE::Erase(const std::size_t &offset, const ValueType& invalid_value){
6562
PL_ASSERT(offset <= LOCK_FREE_ARRAY_MAX_SIZE);
6663
LOG_TRACE("Erase at %lu", offset);
67-
lock_free_array->at(offset) = invalid_value;
6864
new_lock_free_array.at(offset) = invalid_value;
6965
return true;
7066
}

src/include/common/container/lock_free_array.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class LockFreeArray {
7575
std::atomic<std::size_t> lock_free_array_offset {0};
7676

7777
// lock free array
78-
std::unique_ptr<lock_free_array_t> lock_free_array;
78+
// std::unique_ptr<lock_free_array_t> lock_free_array;
7979
typedef tbb::concurrent_vector<ValueType, tbb::zero_allocator<ValueType>> TBBLockFreeArray;
8080
TBBLockFreeArray new_lock_free_array;
8181

0 commit comments

Comments
 (0)