Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add z/OS support for block allocator#19977

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
DNikolaevAtRocket wants to merge2 commits intoduckdb:main
base:main
Choose a base branch
Loading
fromDNikolaevAtRocket:block-allocator-zos
Open
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
NextNext commit
Add z/OS support to block allocator
Signed-off-by: Dmitry Nikolaev <dnikolaev@rocketsoftware.com>
  • Loading branch information
@DNikolaevAtRocket
DNikolaevAtRocket committedNov 28, 2025
commit761005965b97a7b4d8b174636ce9465b5615baff
14 changes: 14 additions & 0 deletionssrc/storage/block_allocator.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,6 +11,9 @@
#else
#include <sys/mman.h>
#endif
#ifdef __MVS__
#include <zos-tls.h>
#endif

namespace duckdb {

Expand DownExpand Up@@ -67,6 +70,9 @@ static void OnDeallocation(const data_ptr_t pointer, const idx_t size) {
success = VirtualFree(pointer, size, MEM_DECOMMIT);
#elif defined(__APPLE__)
success = madvise(pointer, size, MADV_FREE_REUSABLE) == 0;
#elif defined(__MVS__)
// the madvice functionality is not available on z/OS in any form
success = true;
#else
success = madvise(pointer, size, MADV_DONTNEED) == 0;
#endif
Expand DownExpand Up@@ -187,9 +193,17 @@ class BlockAllocatorThreadLocalState {
};

BlockAllocatorThreadLocalState &GetBlockAllocatorThreadLocalState(const BlockAllocator &block_allocator) {
#ifdef __MVS__
auto allocator_state = BlockAllocatorThreadLocalState(block_allocator);
static __tlssim<BlockAllocatorThreadLocalState> local_state_impl(allocator_state);
auto *local_state = local_state_impl.access();
(*local_state).TryInitialize(block_allocator);
return *local_state;
#else
thread_local BlockAllocatorThreadLocalState local_state(block_allocator);
local_state.TryInitialize(block_allocator);
return local_state;
#endif
}

//===--------------------------------------------------------------------===//
Expand Down
4 changes: 0 additions & 4 deletionstest/persistence/test_locking.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,10 +7,6 @@
#include <sys/mman.h>
#include <unistd.h>

#ifdef __MVS__
#define MAP_ANONYMOUS 0x0
#endif

using namespace duckdb;
using namespace std;

Expand Down
4 changes: 0 additions & 4 deletionstest/persistence/test_persistence.cpp
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,10 +7,6 @@
#include<sys/mman.h>
#include<unistd.h>

#ifdef __MVS__
#defineMAP_ANONYMOUS0x0
#endif

usingnamespaceduckdb;
usingnamespacestd;

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp