Skip to content

Commit

Permalink
fuchsia: Implement base::SharedMemory::GetHandleLimit()
Browse files Browse the repository at this point in the history
There's no documented handle limit on Fuchsia, and it looks like this
function is used for questionable purposes anyway, so just return
::max().

Bug: 743296
Change-Id: I4e85f31eb519d5dc2d96882d793b9e2c4afc7851
Reviewed-on: https://chromium-review.googlesource.com/597008
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491387}
  • Loading branch information
sgraham authored and Commit Bot committed Aug 2, 2017
1 parent bac0f1a commit ed94274
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions base/memory/shared_memory_fuchsia.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "base/memory/shared_memory.h"

#include <limits>

#include <magenta/process.h>
#include <magenta/rights.h>
#include <magenta/syscalls.h>
Expand Down Expand Up @@ -36,6 +38,12 @@ void SharedMemory::CloseHandle(const SharedMemoryHandle& handle) {
handle.Close();
}

// static
size_t SharedMemory::GetHandleLimit() {
// No documented limit, currently.
return std::numeric_limits<size_t>::max();
}

bool SharedMemory::CreateAndMapAnonymous(size_t size) {
return CreateAnonymous(size) && Map(size);
}
Expand Down

0 comments on commit ed94274

Please sign in to comment.