Skip to content

Commit

Permalink
RavenDB-22457 - Fixing build on 32 bits
Browse files Browse the repository at this point in the history
  • Loading branch information
ayende committed Aug 28, 2024
1 parent d034f3a commit 2ba529e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/Raven.Pal/src/win/pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,16 @@ rvn_close_pager(
}
}
}
else // OPEN_FILE_DO_NOT_MAP
{
if(!CloseHandle(handle_ptr->file_mapping_handle))
{
if (*detailed_error_code == 0)
*detailed_error_code = GetLastError();
if (rc == SUCCESS)
rc = FAIL_CLOSE;
}
}
if (!CloseHandle(handle_ptr->file_handle))
{
if (*detailed_error_code == 0)
Expand Down
5 changes: 4 additions & 1 deletion src/Voron/Impl/Journal/JournalWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ public void Write(long posBy4Kb, byte* p, int numberOf4Kb)

public (Pager Pager, Pager.State State) CreatePager()
{
return Pager.Create(_options, FileName.FullPath, 0, Pal.OpenFileFlags.None);
var flags = Pal.OpenFileFlags.None;
if(_options.ForceUsing32BitsPager || PlatformDetails.Is32Bits)
flags |= Pal.OpenFileFlags.DoNotMap;
return Pager.Create(_options, FileName.FullPath, 0, flags);
}

public void Read(byte* buffer, long numOfBytes, long offsetInFile)
Expand Down
1 change: 1 addition & 0 deletions src/Voron/Impl/Paging/Pager.32.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
Expand Down

0 comments on commit 2ba529e

Please sign in to comment.