Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/mozglue/linker/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 950 B image not shown  

Quelle  Mappable.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 <fcntl.h>
#include <sys/stat.h>

#include "Mappable.h"

Mappable* Mappable::Create(const char* path) {
  int fd = open(path, O_RDONLY);
  if (fd != -1return new Mappable(fd);
  return nullptr;
}

MemoryRange Mappable::mmap(const void* addr, size_t length, int prot, int flags,
                           off_t offset) {
  MOZ_ASSERT(fd && *fd != -1);
  MOZ_ASSERT(!(flags & MAP_SHARED));
  flags |= MAP_PRIVATE;

  return MemoryRange::mmap(const_cast<void*>(addr), length, prot, flags, *fd,
                           offset);
}

void Mappable::finalize() {
  /* Close file ; equivalent to close(fd.forget()) */
  fd.emplace(-1);
}

size_t Mappable::GetLength() const {
  struct stat st;
  return fstat(*fd, &st) ? 0 : st.st_size;
}

Messung V0.5 in Prozent
C=86 H=97 G=91

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet am  2026-06-04) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

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.