Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

Commit 8e5eec1

Browse files
Merge pull request #1142 from lukaszstolarczuk/merge-stable-1.12-into-master
Merge stable-1.12 into master
2 parents ba8f96e + 177238b commit 8e5eec1

File tree

19 files changed

+131
-49
lines changed

19 files changed

+131
-49
lines changed

.github/workflows/gha.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ jobs:
8484
steps:
8585
- name: Clone the git repo
8686
uses: actions/checkout@v2
87+
with:
88+
fetch-depth: 0
8789

8890
- name: Pull the image
8991
run: cd $WORKDIR && ${{ matrix.CONFIG }} ./pull-or-rebuild-image.sh pull

ChangeLog

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
XXX Igor Chorążewicz <igor.chorazewicz@intel.com>
1+
XXX XXX XXX Igor Chorążewicz <igor.chorazewicz@intel.com>
22

33
* Version 1.13
44

@@ -13,6 +13,37 @@ XXX Igor Chorążewicz <igor.chorazewicz@intel.com>
1313
it's relevant for a GitHub users (who may e.g. run some benchmarks)
1414
-
1515

16+
Tue Jul 06 2021 Łukasz Stolarczuk <lukasz.stolarczuk@intel.com>
17+
18+
* Version 1.6.1
19+
20+
This release fixes minor bugs.
21+
22+
This is the last patch release for libpmemobj-cpp 1.6 version.
23+
Maintenance of this version is no longer supported.
24+
25+
Notable changes:
26+
- string: fix max_size() return value
27+
- allocation_flag: mark constructor as explicit
28+
- peristent_ptr: change ptr_offset_magic to be properly aligned
29+
- fix few headers' includes
30+
31+
Mon Jun 28 2021 Łukasz Stolarczuk <lukasz.stolarczuk@intel.com>
32+
33+
* Version 1.5.2
34+
35+
This release fixes minor bugs.
36+
37+
This is the last patch release for libpmemobj-cpp 1.5 version.
38+
Maintenance of this version is no longer supported.
39+
40+
Notable changes:
41+
- operator[] for contiguous_iterator takes signed integral instead of
42+
unsigned
43+
- throw an exception when pmemobj_mutex_unlock fail
44+
- fix crash when a previous transaction failed to start because of
45+
already taken lock.
46+
1647
Mon Feb 15 2021 Igor Chorążewicz <igor.chorazewicz@intel.com>
1748

1849
* Version 1.12
@@ -216,7 +247,7 @@ Fri Mar 15 2019 Igor Chorążewicz <igor.chorazewicz@intel.com>
216247
- decrease number of persistent_ptr dereferences in
217248
make_persistent_array
218249

219-
Tue Feb 19 2018 Marcin Ślusarz <marcin.slusarz@intel.com>
250+
Tue Feb 19 2019 Marcin Ślusarz <marcin.slusarz@intel.com>
220251

221252
* Version 1.5.1
222253

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# libpmemobj-cpp
22

3-
[![Build Status](https://travis-ci.org/pmem/libpmemobj-cpp.svg?branch=master)](https://travis-ci.org/pmem/libpmemobj-cpp)
43
[![Build status](https://github.com/pmem/libpmemobj-cpp/workflows/CPP/badge.svg)](https://github.com/pmem/libpmemobj-cpp/actions)
54
[![libpmemobj-cpp version](https://img.shields.io/github/tag/pmem/libpmemobj-cpp.svg)](https://github.com/pmem/libpmemobj-cpp/releases/latest)
65
[![Coverity Scan Build Status](https://scan.coverity.com/projects/15911/badge.svg)](https://scan.coverity.com/projects/pmem-libpmemobj-cpp)
@@ -74,6 +73,7 @@ You will need the following packages for compilation:
7473
- **valgrind-devel** (at best with [pmemcheck support](https://github.com/pmem/valgrind))
7574
- **clang-format** 9.0
7675
- **perl**
76+
- **libatomic**
7777
- for Windows compilation:
7878
- [**vcpkg**](https://github.com/microsoft/vcpkg#quick-start-windows)
7979

@@ -170,4 +170,5 @@ or just use graphical CMake frontend like **cmake-qt-gui** or **cmake-curses-gui
170170
## Contact us
171171
For more information on this library, contact Igor Chorążewicz (igor.chorazewicz@intel.com),
172172
Piotr Balcer (piotr.balcer@intel.com) or post on our **#pmem** Slack channel using
173-
[this invite link](https://join.slack.com/t/pmem-io/shared_invite/enQtNzU4MzQ2Mzk3MDQwLWQ1YThmODVmMGFkZWI0YTdhODg4ODVhODdhYjg3NmE4N2ViZGI5NTRmZTBiNDYyOGJjYTIyNmZjYzQxODcwNDg) or [Google group](https://groups.google.com/group/pmem).
173+
[this invite link](https://join.slack.com/t/pmem-io/shared_invite/enQtNzU4MzQ2Mzk3MDQwLWQ1YThmODVmMGFkZWI0YTdhODg4ODVhODdhYjg3NmE4N2ViZGI5NTRmZTBiNDYyOGJjYTIyNmZjYzQxODcwNDg)
174+
or [Google group](https://groups.google.com/group/pmem).

include/libpmemobj++/container/detail/contiguous_iterator.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: BSD-3-Clause
2-
/* Copyright 2018-2020, Intel Corporation */
2+
/* Copyright 2018-2021, Intel Corporation */
33

44
/**
55
* @file
@@ -213,7 +213,7 @@ struct range_snapshotting_iterator
213213
{
214214
assert(data <= ptr);
215215

216-
if (snapshot_size > 0)
216+
if (snapshot_size && ptr)
217217
snapshot_range(ptr);
218218
}
219219

include/libpmemobj++/container/vector.hpp

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: BSD-3-Clause
2-
/* Copyright 2018-2020, Intel Corporation */
2+
/* Copyright 2018-2021, Intel Corporation */
33

44
/**
55
* @file
@@ -644,7 +644,7 @@ vector<T>::assign(size_type count, const_reference value)
644644
add_data_to_tx(0, size_old);
645645

646646
std::fill_n(
647-
&_data[0],
647+
_data.get(),
648648
(std::min)(count,
649649
static_cast<size_type>(size_old)),
650650
value);
@@ -1578,7 +1578,7 @@ vector<T>::insert(const_iterator pos, size_type count, const value_type &value)
15781578
single_element_iterator<value_type>(&value, count));
15791579
});
15801580

1581-
return iterator(&_data[static_cast<difference_type>(idx)]);
1581+
return iterator(_data.get() + static_cast<difference_type>(idx));
15821582
}
15831583

15841584
/**
@@ -1821,7 +1821,7 @@ typename vector<T>::iterator
18211821
vector<T>::erase(const_iterator first, const_iterator last)
18221822
{
18231823
size_type idx = static_cast<size_type>(
1824-
std::distance(const_iterator(&_data[0]), first));
1824+
std::distance(const_iterator(_data.get()), first));
18251825
size_type count = static_cast<size_type>(std::distance(first, last));
18261826

18271827
if (count == 0)
@@ -2293,10 +2293,11 @@ vector<T>::internal_insert(size_type idx, InputIt first, InputIt last)
22932293
auto count = static_cast<size_type>(std::distance(first, last));
22942294

22952295
if (_capacity >= size() + count) {
2296-
pointer dest =
2297-
&_data[static_cast<difference_type>(size() + count)];
2298-
pointer begin = &_data[static_cast<difference_type>(idx)];
2299-
pointer end = &_data[static_cast<difference_type>(size())];
2296+
pointer dest = _data.get() +
2297+
static_cast<difference_type>(size() + count);
2298+
pointer begin = _data.get() + static_cast<difference_type>(idx);
2299+
pointer end =
2300+
_data.get() + static_cast<difference_type>(size());
23002301

23012302
add_data_to_tx(idx, size() - idx + count);
23022303

@@ -2314,9 +2315,11 @@ vector<T>::internal_insert(size_type idx, InputIt first, InputIt last)
23142315

23152316
auto old_data = _data;
23162317
auto old_size = _size;
2317-
pointer old_begin = &_data[0];
2318-
pointer old_mid = &_data[static_cast<difference_type>(idx)];
2319-
pointer old_end = &_data[static_cast<difference_type>(size())];
2318+
pointer old_begin = _data.get();
2319+
pointer old_mid =
2320+
_data.get() + static_cast<difference_type>(idx);
2321+
pointer old_end =
2322+
_data.get() + static_cast<difference_type>(size());
23202323

23212324
_data = nullptr;
23222325
_size = _capacity = 0;
@@ -2384,7 +2387,7 @@ vector<T>::realloc(size_type capacity_new)
23842387

23852388
auto old_data = _data;
23862389
auto old_size = _size;
2387-
pointer old_begin = &_data[0];
2390+
pointer old_begin = _data.get();
23882391
pointer old_end = capacity_new < _size
23892392
? &_data[static_cast<difference_type>(capacity_new)]
23902393
: &_data[static_cast<difference_type>(size())];

include/libpmemobj++/detail/self_relative_ptr_base_impl.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,8 @@ class self_relative_ptr_base_impl {
222222
*/
223223
uintptr_t mask = other_offset == nullptr_offset;
224224
--mask;
225-
uintptr_t ptr = reinterpret_cast<uintptr_t>(
226-
reinterpret_cast<const_byte_ptr_type>(this) +
227-
other_offset + 1);
225+
uintptr_t ptr = static_cast<uintptr_t>(
226+
reinterpret_cast<intptr_t>(this) + other_offset + 1);
228227
ptr &= mask;
229228
return reinterpret_cast<void *>(ptr);
230229
}

tests/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,10 +310,10 @@ if(TEST_SELF_RELATIVE_POINTER)
310310
build_test(self_relative_ptr_arith ptr/self_relative_ptr_arith.cpp)
311311
add_test_generic(NAME self_relative_ptr_arith TRACERS none memcheck pmemcheck)
312312

313-
build_test_atomic(self_relative_ptr_atomic ptr/self_relative_ptr_atomic.cpp)
313+
build_test(self_relative_ptr_atomic ptr/self_relative_ptr_atomic.cpp)
314314
add_test_generic(NAME self_relative_ptr_atomic TRACERS none memcheck drd helgrind)
315315

316-
build_test_atomic(self_relative_ptr_atomic_pmem ptr/self_relative_ptr_atomic_pmem.cpp)
316+
build_test(self_relative_ptr_atomic_pmem ptr/self_relative_ptr_atomic_pmem.cpp)
317317
add_test_generic(NAME self_relative_ptr_atomic_pmem TRACERS none memcheck pmemcheck drd helgrind)
318318
endif()
319319

tests/compatibility/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,20 @@ add_libpmemobj_cpp(1.8.1)
5454
add_libpmemobj_cpp(1.9)
5555
add_libpmemobj_cpp(1.10)
5656
add_libpmemobj_cpp(1.11)
57+
add_libpmemobj_cpp(1.12)
5758

5859
build_test_with_cpp_version(1.7 version_1.7 version/version_1.7.cpp)
5960
build_test_with_cpp_version(1.8.1 version_1.8.1 version/version_1.8.cpp)
6061
build_test_with_cpp_version(1.9 version_1.9 version/version_1.9.cpp)
6162
build_test_with_cpp_version(1.10 version_1.10 version/version_1.10.cpp)
6263
build_test_with_cpp_version(1.11 version_1.11 version/version_1.11.cpp)
64+
build_test_with_cpp_version(1.12 version_1.12 version/version_1.12.cpp)
6365

6466
build_test_with_cpp_version(1.8.1 concurrent_hash_map_feature_size_1.8.1 concurrent_hash_map_feature_size/concurrent_hash_map_feature_size.cpp)
6567
build_test_with_cpp_version(1.9 concurrent_hash_map_feature_size_1.9 concurrent_hash_map_feature_size/concurrent_hash_map_feature_size.cpp)
6668
build_test_with_cpp_version(1.10 concurrent_hash_map_feature_size_1.10 concurrent_hash_map_feature_size/concurrent_hash_map_feature_size.cpp)
6769
build_test_with_cpp_version(1.11 concurrent_hash_map_feature_size_1.11 concurrent_hash_map_feature_size/concurrent_hash_map_feature_size.cpp)
70+
build_test_with_cpp_version(1.12 concurrent_hash_map_feature_size_1.12 concurrent_hash_map_feature_size/concurrent_hash_map_feature_size.cpp)
6871
build_test_with_cpp_version(master concurrent_hash_map_feature_size_master concurrent_hash_map_feature_size/concurrent_hash_map_feature_size.cpp)
6972

7073
add_compatibility_test(concurrent_hash_map_feature_size_1.8.1_master_compatibility concurrent_hash_map_feature_size_1.8.1 concurrent_hash_map_feature_size_master)
@@ -78,3 +81,6 @@ add_compatibility_test(concurrent_hash_map_feature_size_master_1.10_compatibilit
7881

7982
add_compatibility_test(concurrent_hash_map_feature_size_1.11_master_compatibility concurrent_hash_map_feature_size_1.11 concurrent_hash_map_feature_size_master)
8083
add_compatibility_test(concurrent_hash_map_feature_size_master_1.11_compatibility concurrent_hash_map_feature_size_master concurrent_hash_map_feature_size_1.11)
84+
85+
add_compatibility_test(concurrent_hash_map_feature_size_1.12_master_compatibility concurrent_hash_map_feature_size_1.12 concurrent_hash_map_feature_size_master)
86+
add_compatibility_test(concurrent_hash_map_feature_size_master_1.12_compatibility concurrent_hash_map_feature_size_master concurrent_hash_map_feature_size_1.12)

tests/compatibility/version/version_1.10.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
int
77
main()
88
{
9-
static_assert(LIBPMEMOBJ_CPP_VERSION_MAJOR == 1, "");
10-
static_assert(LIBPMEMOBJ_CPP_VERSION_MINOR == 10, "");
9+
static_assert(LIBPMEMOBJ_CPP_VERSION_MAJOR == 1, "Wrong major version");
10+
static_assert(LIBPMEMOBJ_CPP_VERSION_MINOR == 10,
11+
"Wrong minor version");
1112
}

tests/compatibility/version/version_1.11.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
int
77
main()
88
{
9-
static_assert(LIBPMEMOBJ_CPP_VERSION_MAJOR == 1, "");
10-
static_assert(LIBPMEMOBJ_CPP_VERSION_MINOR == 11, "");
9+
static_assert(LIBPMEMOBJ_CPP_VERSION_MAJOR == 1, "Wrong major version");
10+
static_assert(LIBPMEMOBJ_CPP_VERSION_MINOR == 11,
11+
"Wrong minor version");
1112
}

0 commit comments

Comments
 (0)