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

Commit 3a03019

Browse files
Merge pull request #1128 from lukaszstolarczuk/merge-stable-1.6-into-stable-1.7
Merge stable-1.6 into stable-1.7
2 parents ac559e6 + 710d001 commit 3a03019

8 files changed

Lines changed: 106 additions & 16 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright 2018-2020, Intel Corporation
2+
# Copyright 2018-2021, Intel Corporation
33
#
44
# Redistribution and use in source and binary forms, with or without
55
# modification, are permitted provided that the following conditions

ChangeLog

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
Tue Jul 06 2021 Łukasz Stolarczuk <lukasz.stolarczuk@intel.com>
2+
3+
* Version 1.6.1
4+
5+
This release fixes minor bugs.
6+
7+
This is the last patch release for libpmemobj-cpp 1.6 version.
8+
Maintenance of this version is no longer supported.
9+
10+
Notable changes:
11+
- string: fix max_size() return value
12+
- allocation_flag: mark constructor as explicit
13+
- peristent_ptr: change ptr_offset_magic to be properly aligned
14+
- fix few headers' includes
15+
16+
Mon Jun 28 2021 Łukasz Stolarczuk <lukasz.stolarczuk@intel.com>
17+
18+
* Version 1.5.2
19+
20+
This release fixes minor bugs.
21+
22+
This is the last patch release for libpmemobj-cpp 1.5 version.
23+
Maintenance of this version is no longer supported.
24+
25+
Notable changes:
26+
- operator[] for contiguous_iterator takes signed integral instead of
27+
unsigned
28+
- throw an exception when pmemobj_mutex_unlock fail
29+
- fix crash when a previous transaction failed to start because of
30+
already taken lock.
31+
132
Wed Jun 26 2019 Szymon Romik <szymon.romik@intel.com>
233

334
* Version 1.7
@@ -46,7 +77,7 @@ Fri Mar 15 2019 Igor Chorążewicz <igor.chorazewicz@intel.com>
4677
- decrease number of persistent_ptr dereferences in
4778
make_persistent_array
4879

49-
Tue Feb 19 2018 Marcin Ślusarz <marcin.slusarz@intel.com>
80+
Tue Feb 19 2019 Marcin Ślusarz <marcin.slusarz@intel.com>
5081

5182
* Version 1.5.1
5283

include/libpmemobj++/detail/persistent_ptr_base.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2018, Intel Corporation
2+
* Copyright 2016-2021, Intel Corporation
33
*
44
* Redistribution and use in source and binary forms, with or without
55
* modification, are permitted provided that the following conditions
@@ -372,7 +372,10 @@ class persistent_ptr_base {
372372
inline ptrdiff_t
373373
calculate_offset() const
374374
{
375-
static const ptrdiff_t ptr_offset_magic = 0xDEADBEEF;
375+
static const ptrdiff_t ptr_offset_magic = 0xF00000000000000;
376+
377+
static_assert(ptr_offset_magic % alignof(U) == 0, "");
378+
static_assert(ptr_offset_magic % alignof(T) == 0, "");
376379

377380
U *tmp{reinterpret_cast<U *>(ptr_offset_magic)};
378381
T *diff = static_cast<T *>(tmp);

include/libpmemobj++/experimental/contiguous_iterator.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2020, Intel Corporation
2+
* Copyright 2018-2021, Intel Corporation
33
*
44
* Redistribution and use in source and binary forms, with or without
55
* modification, are permitted provided that the following conditions
@@ -245,7 +245,7 @@ struct range_snapshotting_iterator
245245
{
246246
assert(data <= ptr);
247247

248-
if (snapshot_size > 0)
248+
if (snapshot_size && ptr)
249249
snapshot_range(ptr);
250250
}
251251

tests/memcheck-libunwind.supp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,17 @@
2121
obj:*libunwind*
2222
...
2323
}
24+
{
25+
libunwind calls glibc's setcontext on some architectures, e.g. ppc
26+
Memcheck:Addr8
27+
fun:setcontext*
28+
...
29+
}
30+
{
31+
libunwind exception suppresion
32+
Memcheck:Param
33+
write(buf)
34+
...
35+
obj:*libunwind*
36+
...
37+
}

tests/ptr/ptr.cpp

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2019, Intel Corporation
2+
* Copyright 2015-2021, Intel Corporation
33
*
44
* Redistribution and use in source and binary forms, with or without
55
* modification, are permitted provided that the following conditions
@@ -344,6 +344,38 @@ test_offset(nvobj::pool<root> &pop)
344344
UT_ASSERT(0);
345345
}
346346
}
347+
348+
/*
349+
* test_offset_with_alignment -- test offset calculation within a hierarchy of
350+
* objects with different alignments
351+
*/
352+
void
353+
test_offset_alignment(nvobj::pool<root> &pop)
354+
{
355+
struct A {
356+
char a;
357+
};
358+
359+
struct B {
360+
uint64_t b;
361+
};
362+
363+
struct C : public A, public B {
364+
uint64_t c;
365+
};
366+
367+
try {
368+
nvobj::transaction::run(pop, [] {
369+
auto cptr = nvobj::make_persistent<C>();
370+
nvobj::persistent_ptr<B> bptr = cptr;
371+
UT_ASSERT((bptr.raw().off - cptr.raw().off) ==
372+
alignof(B));
373+
nvobj::delete_persistent<C>(cptr);
374+
});
375+
} catch (...) {
376+
UT_ASSERT(0);
377+
}
378+
}
347379
}
348380

349381
int
@@ -370,6 +402,7 @@ main(int argc, char *argv[])
370402
test_ptr_transactional(pop);
371403
test_ptr_array(pop);
372404
test_offset(pop);
405+
test_offset_alignment(pop);
373406

374407
pop.close();
375408

travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ before_install:
2020
- export GITHUB_REPO=pmem/libpmemobj-cpp
2121
- export DOCKERHUB_REPO=pmem/libpmemobj-cpp
2222
- cd utils/docker
23-
- ./pull-or-rebuild-image.sh
23+
- ./pull-or-rebuild-image.sh rebuild
2424
- if [[ -f push_image_to_repo_flag ]]; then PUSH_THE_IMAGE=1; fi
2525
- if [[ -f skip_build_package_check ]]; then export SKIP_CHECK=1; fi
2626
- rm -f push_image_to_repo_flag skip_build_package_check

utils/docker/pull-or-rebuild-image.sh

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,18 @@
3434
# pull-or-rebuild-image.sh - rebuilds the Docker image used in the
3535
# current Travis build if necessary.
3636
#
37-
# The script rebuilds the Docker image if the Dockerfile for the current
38-
# OS version (Dockerfile.${OS}-${OS_VER}) or any .sh script from the directory
39-
# with Dockerfiles were modified and committed.
37+
# The script rebuilds the Docker image if:
38+
# 1. the Dockerfile for the current OS version (Dockerfile.${OS}-${OS_VER})
39+
# or any .sh script in the Dockerfiles directory were modified and committed, or
40+
# 2. "rebuild" param was passed as a first argument to this script.
4041
#
4142
# If the Travis build is not of the "pull_request" type (i.e. in case of
4243
# merge after pull_request) and it succeed, the Docker image should be pushed
4344
# to the Docker Hub repository. An empty file is created to signal that to
4445
# further scripts.
4546
#
4647
# If the Docker image does not have to be rebuilt, it will be pulled from
47-
# Docker Hub.
48+
# the Docker Hub.
4849
#
4950

5051
set -e
@@ -75,6 +76,18 @@ if [[ -z "$HOST_WORKDIR" ]]; then
7576
exit 1
7677
fi
7778

79+
# Path to directory with Dockerfiles and image building scripts
80+
images_dir_name=images
81+
base_dir=utils/docker/$images_dir_name
82+
83+
# If "rebuild" param is passed to the script, force rebuild
84+
if [[ "${1}" == "rebuild" ]]; then
85+
pushd ${images_dir_name}
86+
./build-image.sh ${DOCKERHUB_REPO} ${OS}-${OS_VER}
87+
popd
88+
exit 0
89+
fi
90+
7891
# TRAVIS_COMMIT_RANGE is usually invalid for force pushes - ignore such values
7992
# when used with non-upstream repository
8093
if [ -n "$TRAVIS_COMMIT_RANGE" -a $TRAVIS_REPO_SLUG != "${GITHUB_REPO}" ]; then
@@ -102,10 +115,6 @@ files=$(for commit in $commits; do git diff-tree --no-commit-id --name-only \
102115
echo "Files modified within the commit range:"
103116
for file in $files; do echo $file; done
104117

105-
# Path to directory with Dockerfiles and image building scripts
106-
images_dir_name=images
107-
base_dir=utils/docker/$images_dir_name
108-
109118
# Check if committed file modifications require the Docker image to be rebuilt
110119
for file in $files; do
111120
# Check if modified files are relevant to the current build

0 commit comments

Comments
 (0)