products/Sources/formale Sprachen/C/Firefox/dom/ipc/   (Sun/Oracle ©)  Datei vom 27.6.2026 mit Größe 1003 B image not shown  

Quellcode-Bibliothek MemMapSnapshot.cpp   Sprache: C

 

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


#include "MemMapSnapshot.h"

#include "mozilla/ResultExtensions.h"
#include "mozilla/ipc/SharedMemoryHandle.h"
#include "nsDebug.h"

namespace mozilla::ipc {

Result<Ok, nsresult> MemMapSnapshot::Init(size_t aSize) {
  MOZ_ASSERT(!mMem);

  auto handle = shared_memory::CreateFreezable(aSize);
  if (NS_WARN_IF(!handle)) {
    return Err(NS_ERROR_FAILURE);
  }

  auto mem = std::move(handle).Map();
  if (NS_WARN_IF(!mem)) {
    return Err(NS_ERROR_FAILURE);
  }

  mMem = std::move(mem);
  return Ok();
}

Result<ReadOnlySharedMemoryHandle, nsresult> MemMapSnapshot::Finalize() {
  MOZ_ASSERT(mMem);

  auto readOnlyHandle = std::move(mMem).Freeze();
  if (NS_WARN_IF(!readOnlyHandle)) {
    return Err(NS_ERROR_FAILURE);
  }

  return std::move(readOnlyHandle);
}

}  // namespace mozilla::ipc

Messung V0.5 in Prozent
C=96 H=100 G=97

¤ Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.0.2Bemerkung:  ¤

*Bot Zugriff






über den Urheber dieser Seite

Die Firma ist wie angegeben erreichbar.

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.