Skip to content

Commit de966b5

Browse files
authored
Merge branch 'Tencent:master' into rust
2 parents 8d0706b + 08a9cf1 commit de966b5

File tree

19 files changed

+80
-35
lines changed

19 files changed

+80
-35
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## v2.1.14
2+
3+
* Support 16kb pagesize for Android
4+
* Supports using ksp in Kotlin version 2.1.0+
5+
* Fix stack overflow crash
6+
* Fix some known bugs
7+
18
## v2.1.13
29

310
* Fix compile error of Swift Package Manager

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# WCDB
22

33
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Tencent/wcdb/pulls)
4-
[![Release Version](https://img.shields.io/badge/Release-2.1.13-brightgreen.svg)](https://github.com/Tencent/wcdb/releases)
4+
[![Release Version](https://img.shields.io/badge/Release-2.1.14-brightgreen.svg)](https://github.com/Tencent/wcdb/releases)
55
[![Language](https://img.shields.io/badge/Language-%20C++%20%7C%20Java%20%7C%20Kotlin%20%7C%20Swift%20%7C%20Objc-brightgreen.svg)](https://github.com/Tencent/wcdb/wiki)[![Platform](https://img.shields.io/badge/Platform-%20iOS%20%7C%20macOS%20%7C%20Android%20%7C%20Windows%20%7C%20Linux%20%7C%20OpenHarmony-brightgreen.svg)](https://github.com/Tencent/wcdb/wiki)
66

77
中文版本请参看[这里][wcdb-wiki]
@@ -115,6 +115,8 @@ Tutorials of different languages can be found below:
115115
116116
If you are interested in contributing, check out the [CONTRIBUTING.md], also join our [Tencent OpenSource Plan](https://opensource.tencent.com/contribution).
117117
118+
WCDB 正式加入[TDS 腾讯端服务产品联盟](https://tds-union.qq.com/),携手联盟其他成员,共同致力于构建开放共赢的大前端技术产品生态。
119+
118120
# 信息公示
119121
120122
* 开发者: 深圳市腾讯计算机系统有限公司

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.13
1+
2.1.14

WCDB.cpp.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# pod trunk push WCDB.cpp.podspec --verbose --skip-import-validation --allow-warnings
55
Pod::Spec.new do |wcdb|
66
wcdb.name = "WCDB.cpp"
7-
wcdb.version = "2.1.13"
7+
wcdb.version = "2.1.14"
88
wcdb.summary = "WCDB is a cross-platform database framework developed by WeChat."
99
wcdb.description = <<-DESC
1010
The WeChat Database, for C++. (If you want to use WCDB for Swift or Objective-C, see the "WCDB.swift" pod or "WCDB.objc" pod. If you want to use WCDB for C++/Objc/Swift in one project, see the "WCDB" pod)

WCDB.objc.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# pod trunk push WCDB.objc.podspec --verbose --skip-import-validation --allow-warnings
55
Pod::Spec.new do |wcdb|
66
wcdb.name = "WCDB.objc"
7-
wcdb.version = "2.1.13"
7+
wcdb.version = "2.1.14"
88
wcdb.summary = "WCDB is a cross-platform database framework developed by WeChat."
99
wcdb.description = <<-DESC
1010
The WeChat Database, for Objective-C. (If you want to use WCDB for Swift or C++, see the "WCDB.swift" pod or "WCDB.cpp" pod. If you want to use WCDB for C++/Objc/Swift in one project, see the "WCDB" pod)

WCDB.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# pod trunk push --verbose --allow-warnings WCDB.podspec --skip-import-validation
55
Pod::Spec.new do |wcdb|
66
wcdb.name = "WCDB"
7-
wcdb.version = "2.1.13"
7+
wcdb.version = "2.1.14"
88
wcdb.summary = "WCDB is a cross-platform database framework developed by WeChat."
99
wcdb.description = <<-DESC
1010
The WeChat Database, for Objc/Swift/C++. (If you want to use WCDB for Objc/Swift/C++ separately, see the "WCDB.objc", "WCDB.swift" or "WCDB.cpp" pod.)

WCDB.swift.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# pod trunk push --verbose --allow-warnings WCDB.swift.podspec
55
Pod::Spec.new do |wcdb|
66
wcdb.name = "WCDB.swift"
7-
wcdb.version = "2.1.13"
7+
wcdb.version = "2.1.14"
88
wcdb.summary = "WCDB is a cross-platform database framework developed by WeChat."
99
wcdb.description = <<-DESC
1010
The WeChat Database, for Swift. (If you want to use WCDB for Objective-C or C++, see the "WCDB.objc" pod or "WCDB.cpp" pod. If you want to use WCDB for C++/Objc/Swift in one project, see the "WCDB" pod)

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ endif ()
505505
if (ANDROID)
506506
message(STATUS "---- BUILD FOR ANDROID ----")
507507
find_library(z-lib z)
508+
target_link_options(${TARGET_NAME} PRIVATE "-Wl,-z,max-page-size=16384")
508509
target_link_libraries(${TARGET_NAME} PUBLIC
509510
${LINK_LIBRARIES}
510511
${z-lib})

src/common/base/FileManager.cpp

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ bool FileManager::createFileHardLink(const UnsafeStringView &from, const UnsafeS
167167
if (CreateHardLinkW(GetPathString(to), GetPathString(from), NULL)) {
168168
return true;
169169
}
170+
if (CopyFile(GetPathString(from), GetPathString(to), true)) {
171+
return true;
172+
}
170173
setThreadedWinError(to);
171174
return false;
172175
#endif
@@ -319,23 +322,27 @@ Optional<uint32_t> FileManager::getFileIdentifier(const UnsafeStringView &path)
319322
setThreadedWinError(path);
320323
return NullOpt;
321324
}
322-
FILE_ID_INFO fileIdInfo;
323-
if (!GetFileInformationByHandleEx(hFile, FileIdInfo, &fileIdInfo, sizeof(fileIdInfo))) {
324-
setThreadedWinError(path);
325+
BY_HANDLE_FILE_INFORMATION fileInfo;
326+
if (GetFileInformationByHandle(hFile, &fileInfo)) {
325327
CloseHandle(hFile);
326-
return NullOpt;
328+
329+
constexpr size_t size = sizeof(fileInfo.nFileIndexHigh)
330+
+ sizeof(fileInfo.nFileIndexLow)
331+
+ sizeof(fileInfo.dwVolumeSerialNumber);
332+
unsigned char buffer[size];
333+
memcpy(buffer, &fileInfo.nFileIndexHigh, sizeof(fileInfo.nFileIndexHigh));
334+
memcpy(buffer + sizeof(fileInfo.nFileIndexHigh),
335+
&fileInfo.nFileIndexLow,
336+
sizeof(fileInfo.nFileIndexLow));
337+
memcpy(buffer + sizeof(fileInfo.nFileIndexHigh) + sizeof(fileInfo.nFileIndexLow),
338+
&fileInfo.dwVolumeSerialNumber,
339+
sizeof(fileInfo.dwVolumeSerialNumber));
340+
return UnsafeData(buffer, size).hash();
327341
}
328-
CloseHandle(hFile);
329342

330-
// Copy FileID and VolumeSerialNumber to a buffer
331-
constexpr size_t size
332-
= sizeof(fileIdInfo.FileId) + sizeof(fileIdInfo.VolumeSerialNumber);
333-
unsigned char buffer[size];
334-
memcpy(buffer, &fileIdInfo.FileId, sizeof(fileIdInfo.FileId));
335-
memcpy(buffer + sizeof(fileIdInfo.FileId),
336-
&fileIdInfo.VolumeSerialNumber,
337-
sizeof(fileIdInfo.VolumeSerialNumber));
338-
return UnsafeData(buffer, size).hash();
343+
setThreadedWinError(path);
344+
CloseHandle(hFile);
345+
return NullOpt;
339346
#endif
340347
}
341348

src/common/base/Lock.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ void SharedLock::lock()
114114
Thread current = Thread::current();
115115
std::unique_lock<std::mutex> lockGuard(m_lock);
116116
if (!m_locking.equal(current)) {
117-
m_pendingWriters.emplace(current);
117+
m_pendingWriters.push_back(current);
118118
while (m_readers > 0 || m_writers > 0 || !m_pendingWriters.front().equal(current)) {
119119
m_conditionalWriters.wait(lockGuard);
120120
}
121121
WCTAssert(m_pendingWriters.front().isCurrentThread());
122-
m_pendingWriters.pop();
122+
m_pendingWriters.pop_front();
123123
}
124124
// it's already locked by current thread
125125
// or it's not locked and it's not shared locked

0 commit comments

Comments
 (0)