Skip to content

Commit

Permalink
Disable virtual mem warnings on macos harvester
Browse files Browse the repository at this point in the history
  • Loading branch information
haorldbchi committed Jul 14, 2023
1 parent c0216c9 commit 1e5eb6e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/platform/macos/SysHost_Macos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <fcntl.h>
#include <pthread.h>

#if !defined(BB_IS_HARVESTER)
#if !defined( BB_IS_HARVESTER )
#include <sodium.h>
#endif

Expand Down Expand Up @@ -87,18 +87,22 @@ void* SysHost::VirtualAlloc( size_t size, bool initialize )
ASSERT( ptr );

// #TODO: Use a hinting system for this.
// Hit the memory to be accessed sequentially
// Hint the memory to be accessed sequentially
r = vm_behavior_set( task, ptr, allocSize, VM_BEHAVIOR_SEQUENTIAL );
if( r != 0 )
{
Log::Line( "Warning: vm_behavior_set() failed with error: %d .", (int32)r );
#if !defined( BB_IS_HARVESTER )
Log::Line( "Warning: vm_behavior_set() failed with error: %d .", (int32)r );
#endif
}

// Try wiring it
r = vm_wire( mach_host_self(), task, ptr, allocSize, VM_PROT_READ | VM_PROT_WRITE );
if( r != 0 )
{
Log::Line( "Warning: vm_wire() failed with error: %d .", (int32)r );
#if !defined( BB_IS_HARVESTER )
Log::Line( "Warning: vm_wire() failed with error: %d .", (int32)r );
#endif
}

// Store page size
Expand Down

0 comments on commit 1e5eb6e

Please sign in to comment.