|
Blender V4.3
|
#include "BLI_mmap.h"#include "BLI_fileops.h"#include "BLI_listbase.h"#include "MEM_guardedalloc.h"#include <string.h>#include <signal.h>#include <stdlib.h>#include <sys/mman.h>#include <unistd.h>Go to the source code of this file.
Classes | |
| struct | BLI_mmap_file |
| struct | error_handler_data |
Functions | |
| static void | sigbus_handler (int sig, siginfo_t *siginfo, void *ptr) |
| static bool | sigbus_handler_setup (void) |
| static void | sigbus_handler_add (BLI_mmap_file *file) |
| static void | sigbus_handler_remove (BLI_mmap_file *file) |
| BLI_mmap_file * | BLI_mmap_open (int fd) |
| bool | BLI_mmap_read (BLI_mmap_file *file, void *dest, size_t offset, size_t length) |
| void * | BLI_mmap_get_pointer (BLI_mmap_file *file) |
| size_t | BLI_mmap_get_length (const BLI_mmap_file *file) |
| void | BLI_mmap_free (BLI_mmap_file *file) |
Variables | |
| static struct error_handler_data | error_handler = {0} |
| void BLI_mmap_free | ( | BLI_mmap_file * | file | ) |
Definition at line 221 of file BLI_mmap.c.
References MEM_freeN(), and sigbus_handler_remove().
Referenced by imb_load_filepath_thumbnail_webp(), IMB_loadifffile(), memory_close_mmap(), and IMMapStream::~IMMapStream().
| size_t BLI_mmap_get_length | ( | const BLI_mmap_file * | file | ) |
Definition at line 216 of file BLI_mmap.c.
Referenced by BLI_filereader_new_mmap(), imb_load_filepath_thumbnail_webp(), IMB_loadifffile(), and IMMapStream::IMMapStream().
| void * BLI_mmap_get_pointer | ( | BLI_mmap_file * | file | ) |
Definition at line 211 of file BLI_mmap.c.
Referenced by imb_load_filepath_thumbnail_webp(), IMB_loadifffile(), and IMMapStream::IMMapStream().
| BLI_mmap_file * BLI_mmap_open | ( | int | fd | ) |
Definition at line 132 of file BLI_mmap.c.
References BLI_lseek(), file, length(), MEM_callocN, NULL, sigbus_handler_add(), sigbus_handler_setup(), and UNLIKELY.
Referenced by BLI_filereader_new_mmap(), imb_load_filepath_thumbnail_webp(), IMB_loadifffile(), and IMMapStream::IMMapStream().
| bool BLI_mmap_read | ( | BLI_mmap_file * | file, |
| void * | dest, | ||
| size_t | offset, | ||
| size_t | length ) |
Definition at line 182 of file BLI_mmap.c.
Referenced by memory_read_mmap().
|
static |
Definition at line 61 of file BLI_mmap.c.
References BLI_assert, error_handler, BLI_mmap_file::io_error, LISTBASE_FOREACH, error_handler_data::next_handler, error_handler_data::open_mmaps, and ptr.
Referenced by sigbus_handler_setup().
|
static |
Definition at line 119 of file BLI_mmap.c.
References BLI_addtail(), BLI_genericNodeN(), error_handler, and error_handler_data::open_mmaps.
Referenced by BLI_mmap_open().
|
static |
Definition at line 125 of file BLI_mmap.c.
References BLI_findptr(), BLI_freelinkN(), error_handler, offsetof, and error_handler_data::open_mmaps.
Referenced by BLI_mmap_free().
|
static |
Definition at line 97 of file BLI_mmap.c.
References error_handler_data::configured, error_handler, error_handler_data::next_handler, and sigbus_handler().
Referenced by BLI_mmap_open().
|
static |
Referenced by sigbus_handler(), sigbus_handler_add(), sigbus_handler_remove(), and sigbus_handler_setup().