Skip to content

Commit

Permalink
Update WindowsSharedMemory.java
Browse files Browse the repository at this point in the history
  • Loading branch information
ShirasawaSama authored Mar 16, 2024
1 parent e8a0915 commit 7490195
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/cn/apisium/shm/impl/WindowsSharedMemory.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public WindowsSharedMemory(String name, int size, boolean isCreate) throws Throw
0,
size,
(MemorySegment) Arena.ofAuto().allocateUtf8String(name)
) : (MemorySegment) openFileMapping.invokeExact(SECTION_MAP_WRITE | SECTION_MAP_READ, 0, name);
) : (MemorySegment) openFileMapping.invokeExact(SECTION_MAP_WRITE | SECTION_MAP_READ, 0, (MemorySegment) Arena.ofAuto().allocateUtf8String(name));
if (hMapFile.address() == 0) throw new IllegalStateException("CreateFileMapping failed.");
try {
segment = (MemorySegment) mapViewOfFile.invokeExact(hMapFile, SECTION_MAP_WRITE | SECTION_MAP_READ, 0, 0, size);
Expand All @@ -87,4 +87,4 @@ public void close() throws Exception {
throw new Exception(throwable);
}
}
}
}

0 comments on commit 7490195

Please sign in to comment.