#include <fcntl.h>
#include <stddef.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>
#include <cerrno>
#include "tensorflow/lite/allocation.h"
#include "tensorflow/lite/core/api/error_reporter.h"
namespace tflite {
namespace {
size_t GetFdSizeBytes(int fd) { … }
}
MMAPAllocation::MMAPAllocation(const char* filename,
ErrorReporter* error_reporter)
: … { … }
MMAPAllocation::MMAPAllocation(int fd, ErrorReporter* error_reporter)
: … { … }
MMAPAllocation::MMAPAllocation(int fd, size_t offset, size_t length,
ErrorReporter* error_reporter)
: … { … }
MMAPAllocation::MMAPAllocation(ErrorReporter* error_reporter, int owned_fd)
: … { … }
MMAPAllocation::MMAPAllocation(ErrorReporter* error_reporter, int owned_fd,
size_t offset, size_t length)
: … { … }
MMAPAllocation::~MMAPAllocation() { … }
const void* MMAPAllocation::base() const { … }
size_t MMAPAllocation::bytes() const { … }
bool MMAPAllocation::valid() const { … }
bool MMAPAllocation::IsSupported() { … }
}