![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Go to the source code of this file.
Data Structures | |
struct | dt_cache_entry_t |
struct | dt_cache_t |
Macros | |
#define | dt_cache_get(A, B, C) dt_cache_get_with_caller(A, B, C, __FILE__, __LINE__) |
#define | dt_cache_release(A, B) dt_cache_release_with_caller(A, B, __FILE__, __LINE__) |
Typedefs | |
typedef struct dt_cache_entry_t | dt_cache_entry_t |
typedef struct dt_cache_t | dt_cache_t |
Functions | |
typedef | void ((*dt_cache_allocate_t)(void *userdata, dt_cache_entry_t *entry)) |
void | dt_cache_init (dt_cache_t *cache, size_t entry_size, size_t cost_quota) |
void | dt_cache_cleanup (dt_cache_t *cache) |
static void | dt_cache_set_allocate_callback (dt_cache_t *cache, dt_cache_allocate_t allocate_cb, void *allocate_data) |
static void | dt_cache_set_cleanup_callback (dt_cache_t *cache, dt_cache_cleanup_t cleanup_cb, void *cleanup_data) |
dt_cache_entry_t * | dt_cache_get_with_caller (dt_cache_t *cache, const uint32_t key, char mode, const char *file, int line) |
dt_cache_entry_t * | dt_cache_testget (dt_cache_t *cache, const uint32_t key, char mode) |
void | dt_cache_release_with_caller (dt_cache_t *cache, dt_cache_entry_t *entry, const char *file, int line) |
int32_t | dt_cache_contains (dt_cache_t *cache, const uint32_t key) |
int32_t | dt_cache_remove (dt_cache_t *cache, const uint32_t key) |
void | dt_cache_gc (dt_cache_t *cache, const float fill_ratio) |
int | dt_cache_for_all (dt_cache_t *cache, int(*process)(const uint32_t key, const void *data, void *user_data), void *user_data) |
#define dt_cache_get | ( | A, | |
B, | |||
C | |||
) | dt_cache_get_with_caller(A, B, C, __FILE__, __LINE__) |
#define dt_cache_release | ( | A, | |
B | |||
) | dt_cache_release_with_caller(A, B, __FILE__, __LINE__) |
typedef struct dt_cache_entry_t dt_cache_entry_t |
typedef struct dt_cache_t dt_cache_t |
void dt_cache_cleanup | ( | dt_cache_t * | cache | ) |
References ASAN_UNPOISON_MEMORY_REGION, dt_cache_t::cleanup, dt_cache_t::cleanup_data, dt_cache_entry_t::data, dt_cache_entry_t::data_size, dt_free_align, dt_pthread_mutex_destroy(), dt_pthread_rwlock_destroy, dt_cache_t::hashtable, dt_cache_entry_t::lock, dt_cache_t::lock, and dt_cache_t::lru.
Referenced by dt_image_cache_cleanup(), dt_mipmap_cache_cleanup(), and main().
int32_t dt_cache_contains | ( | dt_cache_t * | cache, |
const uint32_t | key | ||
) |
References dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_cache_t::hashtable, key, and dt_cache_t::lock.
Referenced by main().
int dt_cache_for_all | ( | dt_cache_t * | cache, |
int(*)(const uint32_t key, const void *data, void *user_data) | process, | ||
void * | user_data | ||
) |
void dt_cache_gc | ( | dt_cache_t * | cache, |
const float | fill_ratio | ||
) |
References dt_cache_entry_t::_lock_demoting, ASAN_UNPOISON_MEMORY_REGION, dt_cache_t::cleanup, dt_cache_t::cleanup_data, dt_cache_entry_t::cost, dt_cache_t::cost, dt_cache_t::cost_quota, dt_cache_entry_t::data, dt_cache_entry_t::data_size, dt_free_align, dt_pthread_rwlock_destroy, dt_pthread_rwlock_trywrlock, dt_pthread_rwlock_unlock, dt_cache_t::hashtable, dt_cache_entry_t::key, dt_cache_entry_t::link, dt_cache_entry_t::lock, and dt_cache_t::lru.
Referenced by dt_cache_get_with_caller().
dt_cache_entry_t * dt_cache_get_with_caller | ( | dt_cache_t * | cache, |
const uint32_t | key, | ||
char | mode, | ||
const char * | file, | ||
int | line | ||
) |
References dt_cache_entry_t::_lock_demoting, dt_cache_t::allocate, dt_cache_t::allocate_data, ASAN_POISON_MEMORY_REGION, dt_cache_entry_t::cost, dt_cache_t::cost, dt_cache_t::cost_quota, dt_cache_entry_t::data, dt_cache_entry_t::data_size, dt_alloc_align, dt_cache_gc(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_pthread_rwlock_init, dt_pthread_rwlock_rdlock_with_caller, dt_pthread_rwlock_tryrdlock_with_caller, dt_pthread_rwlock_trywrlock_with_caller, dt_pthread_rwlock_wrlock_with_caller, dt_cache_t::entry_size, dt_cache_t::hashtable, dt_cache_entry_t::key, key, dt_cache_entry_t::link, dt_cache_entry_t::lock, dt_cache_t::lock, and dt_cache_t::lru.
Referenced by dt_mipmap_cache_get_with_caller().
void dt_cache_init | ( | dt_cache_t * | cache, |
size_t | entry_size, | ||
size_t | cost_quota | ||
) |
References dt_cache_t::allocate, dt_cache_t::allocate_data, dt_cache_t::cleanup, dt_cache_t::cleanup_data, dt_cache_t::cost, dt_cache_t::cost_quota, dt_pthread_mutex_init(), dt_cache_t::entry_size, dt_cache_t::hashtable, dt_cache_t::lock, and dt_cache_t::lru.
Referenced by dt_image_cache_init(), dt_mipmap_cache_init(), and main().
void dt_cache_release_with_caller | ( | dt_cache_t * | cache, |
dt_cache_entry_t * | entry, | ||
const char * | file, | ||
int | line | ||
) |
References ASAN_POISON_MEMORY_REGION, dt_cache_entry_t::data, dt_cache_entry_t::data_size, dt_pthread_rwlock_unlock, and dt_cache_entry_t::lock.
Referenced by dt_mipmap_cache_release_with_caller().
int32_t dt_cache_remove | ( | dt_cache_t * | cache, |
const uint32_t | key | ||
) |
References dt_cache_entry_t::_lock_demoting, ASAN_UNPOISON_MEMORY_REGION, dt_cache_t::cleanup, dt_cache_t::cleanup_data, dt_cache_entry_t::cost, dt_cache_t::cost, dt_cache_entry_t::data, dt_cache_entry_t::data_size, dt_free_align, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_pthread_rwlock_destroy, dt_pthread_rwlock_trywrlock, dt_pthread_rwlock_unlock, dt_cache_t::hashtable, key, dt_cache_entry_t::link, dt_cache_entry_t::lock, dt_cache_t::lock, dt_cache_t::lru, and void().
Referenced by dt_image_cache_remove(), dt_mimap_cache_evict(), and dt_mipmap_cache_remove_at_size().
|
inlinestatic |
References dt_cache_t::allocate, and dt_cache_t::allocate_data.
Referenced by dt_image_cache_init(), dt_mipmap_cache_init(), and main().
|
inlinestatic |
References dt_cache_t::cleanup, and dt_cache_t::cleanup_data.
Referenced by dt_image_cache_init(), and dt_mipmap_cache_init().
dt_cache_entry_t * dt_cache_testget | ( | dt_cache_t * | cache, |
const uint32_t | key, | ||
char | mode | ||
) |
References ASAN_POISON_MEMORY_REGION, dt_cache_entry_t::data, dt_cache_entry_t::data_size, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_pthread_rwlock_tryrdlock, dt_pthread_rwlock_trywrlock, dt_cache_t::hashtable, key, dt_cache_entry_t::link, dt_cache_entry_t::lock, dt_cache_t::lock, and dt_cache_t::lru.
Referenced by dt_image_cache_testget(), dt_mipmap_cache_get_with_caller(), and dt_mipmap_cache_remove_at_size().
typedef void | ( | (*)(void *userdata, dt_cache_entry_t *entry) | dt_cache_allocate_t | ) |
Referenced by _backup_db(), _blendop_blendif_disp_alternative_reset(), _brush_duplicate_points(), _circle_duplicate_points(), _circle_events_post_expose(), _circle_get_distance(), _circle_get_points(), _circle_get_points_source(), _delete_child(), _edit_preset_response(), _ellipse_duplicate_points(), _ellipse_events_post_expose(), _ellipse_get_distance(), _event_process_after_preview_callback(), _event_structure_auto_clicked(), _gradient_duplicate_points(), _gradient_events_post_expose(), _gradient_get_distance(), _gradient_get_points_border(), _image_import_internal(), _metadata_get_flags(), _metadata_view_update_values(), _path_duplicate_points(), _prepare_resampling_plan(), camera_autosearch_clicked(), camera_menusearch_clicked(), commit_params(), delete_children(), dt_cache_remove(), dt_dev_add_history_item_ext(), dt_dev_cleanup(), dt_dev_free_history_item(), dt_dev_pixelpipe_cleanup(), dt_dev_pixelpipe_process(), dt_gui_preferences_show(), dt_image_read_duplicates(), dt_imageio_jpeg_decompress(), dt_imageio_jpeg_read(), dt_imageio_open_avif(), dt_imageio_open_j2k(), dt_imageio_open_jpeg(), dt_imageio_open_png(), dt_imageio_open_rawspeed(), dt_imageio_open_tiff(), dt_init(), dt_iop_alloc_image_buffers(), dt_set_signal_handlers(), gui_init(), gui_init(), icuLoadCollation(), icuRegexpFunc(), init_pipe(), key_swap_callback(), leave(), lens_autosearch_clicked(), lens_comboentry_aperture_update(), lens_comboentry_distance_update(), lens_comboentry_focal_update(), lens_menusearch_clicked(), line_detect(), read_image(), sqlite3IcuInit(), write_image(), write_image(), and write_pfm().