mirror of
https://github.com/wassname/ray.git
synced 2026-07-06 05:16:30 +08:00
Some bug fixes for Windows (#7374)
* Fix MAP_SHARED check in sys/mman.h * Fix missing :platform_shims dependency for ray_util * dlmalloc patch for Arrow
This commit is contained in:
@@ -837,6 +837,7 @@ cc_library(
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
":platform_shims",
|
||||
":sha256",
|
||||
"@boost//:asio",
|
||||
"@com_github_google_glog//:glog",
|
||||
|
||||
@@ -188,6 +188,7 @@ def ray_deps_setup():
|
||||
"//thirdparty/patches:arrow-windows-poll.patch",
|
||||
"//thirdparty/patches:arrow-windows-sigpipe.patch",
|
||||
"//thirdparty/patches:arrow-windows-socket.patch",
|
||||
"//thirdparty/patches:arrow-windows-dlmalloc.patch",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ EXTERN_C WINBASEAPI void *WINAPI MapViewOfFile(HANDLE hFileMappingObject,
|
||||
EXTERN_C WINBASEAPI BOOL WINAPI UnmapViewOfFile(void const *lpBaseAddress);
|
||||
static void *mmap(void *addr, size_t len, int prot, int flags, int fd, off_t off) {
|
||||
void *result = (void *)(-1);
|
||||
if (!addr && prot == MAP_SHARED) {
|
||||
if (!addr && (flags & MAP_SHARED)) {
|
||||
/* HACK: we're assuming handle sizes can't exceed 32 bits, which is wrong...
|
||||
* but works for now. */
|
||||
void *ptr = MapViewOfFile((HANDLE)(intptr_t)fd, FILE_MAP_ALL_ACCESS,
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
diff --git cpp/src/plasma/dlmalloc.cc cpp/src/plasma/dlmalloc.cc
|
||||
--- cpp/src/plasma/dlmalloc.cc
|
||||
+++ cpp/src/plasma/dlmalloc.cc
|
||||
@@ -76,5 +76,8 @@ int create_buffer(int64_t size) {
|
||||
- if (!CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE,
|
||||
- (DWORD)((uint64_t)size >> (CHAR_BIT * sizeof(DWORD))),
|
||||
- (DWORD)(uint64_t)size, NULL)) {
|
||||
+ HANDLE h = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE,
|
||||
+ (DWORD)((uint64_t)size >> (CHAR_BIT * sizeof(DWORD))),
|
||||
+ (DWORD)(uint64_t)size, NULL);
|
||||
+ if (h) {
|
||||
+ fd = reinterpret_cast<int>(h);
|
||||
+ } else {
|
||||
fd = -1;
|
||||
}
|
||||
--
|
||||
Reference in New Issue
Block a user