![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Include dependency graph for pixelpipe_cache_alloc.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Functions | |
| void * | dt_pixelpipe_cache_alloc_align_cache_impl (size_t size, int id, const char *name) |
| Allocate aligned memory tracked by the pixelpipe cache. This allows LRU cache entries to be evicted if needed to make room. | |
| void | dt_pixelpipe_cache_free_align_cache (void **mem, const char *message) |
| Free aligned memory allocated with dt_pixelpipe_cache_alloc_align_cache. | |
| static void * | dt_pixelpipe_cache_alloc_perthread_impl (const size_t n, const size_t objsize, size_t *padded_size, const char *message) |
| static void * | dt_pixelpipe_cache_calloc_perthread_impl (const size_t n, const size_t objsize, size_t *padded_size, const char *message) |
| static float * | dt_pixelpipe_cache_alloc_perthread_float_impl (const size_t n, size_t *padded_size, const char *message) |
| #define dt_get_bythread | ( | buf, | |
| padsize, | |||
| tnum | |||
| ) | DT_IS_ALIGNED((buf) + ((padsize) * (tnum))) |
Definition at line 156 of file pixelpipe_cache_alloc.h.
| #define dt_get_perthread | ( | buf, | |
| padsize | |||
| ) | DT_IS_ALIGNED((buf) + ((padsize) * dt_get_thread_num())) |
Definition at line 153 of file pixelpipe_cache_alloc.h.
| #define dt_pixelpipe_cache_alloc_align | ( | size, | |
| pipe | |||
| ) | dt_pixelpipe_cache_alloc_align_cache((size), (pipe)->type) |
Definition at line 67 of file pixelpipe_cache_alloc.h.
| #define dt_pixelpipe_cache_alloc_align_cache | ( | size, | |
| id | |||
| ) | dt_pixelpipe_cache_alloc_align_cache_impl((size), (id), __FILE__ ":" DT_STRINGIFY(__LINE__)) |
Definition at line 63 of file pixelpipe_cache_alloc.h.
| #define dt_pixelpipe_cache_alloc_align_double | ( | count, | |
| pipe | |||
| ) | ((double *)dt_pixelpipe_cache_alloc_align((size_t)(count) * sizeof(double), (pipe))) |
Definition at line 100 of file pixelpipe_cache_alloc.h.
| #define dt_pixelpipe_cache_alloc_align_double_cache | ( | count, | |
| id | |||
| ) | ((double *)dt_pixelpipe_cache_alloc_align_cache((size_t)(count) * sizeof(double), (id))) |
Definition at line 95 of file pixelpipe_cache_alloc.h.
| #define dt_pixelpipe_cache_alloc_align_float | ( | pixels, | |
| pipe | |||
| ) | ((float *)dt_pixelpipe_cache_alloc_align((size_t)(pixels) * sizeof(float), (pipe))) |
Definition at line 72 of file pixelpipe_cache_alloc.h.
| #define dt_pixelpipe_cache_alloc_align_float_cache | ( | pixels, | |
| id | |||
| ) | ((float *)dt_pixelpipe_cache_alloc_align_cache((size_t)(pixels) * sizeof(float), (id))) |
Definition at line 77 of file pixelpipe_cache_alloc.h.
| #define dt_pixelpipe_cache_alloc_align_int | ( | count, | |
| pipe | |||
| ) | ((int *)dt_pixelpipe_cache_alloc_align((size_t)(count) * sizeof(int), (pipe))) |
Definition at line 82 of file pixelpipe_cache_alloc.h.
| #define dt_pixelpipe_cache_alloc_align_int_cache | ( | count, | |
| id | |||
| ) | ((int *)dt_pixelpipe_cache_alloc_align_cache((size_t)(count) * sizeof(int), (id))) |
Definition at line 90 of file pixelpipe_cache_alloc.h.
| #define dt_pixelpipe_cache_alloc_perthread | ( | n, | |
| objsize, | |||
| padded_size | |||
| ) | ((void *)dt_pixelpipe_cache_alloc_perthread_impl((n), (objsize), (padded_size), __FILE__ ":" DT_STRINGIFY(__LINE__))) |
Definition at line 124 of file pixelpipe_cache_alloc.h.
| #define dt_pixelpipe_cache_alloc_perthread_float | ( | n, | |
| padded_size | |||
| ) | ((float *)dt_pixelpipe_cache_alloc_perthread_float_impl((n), (padded_size), __FILE__ ":" DT_STRINGIFY(__LINE__))) |
Definition at line 148 of file pixelpipe_cache_alloc.h.
| #define dt_pixelpipe_cache_calloc_perthread | ( | n, | |
| objsize, | |||
| padded_size | |||
| ) | ((void *)dt_pixelpipe_cache_calloc_perthread_impl((n), (objsize), (padded_size), __FILE__ ":" DT_STRINGIFY(__LINE__))) |
Definition at line 137 of file pixelpipe_cache_alloc.h.
| #define dt_pixelpipe_cache_free_align | ( | mem | ) | dt_pixelpipe_cache_free_align_cache((void **)&(mem), __FILE__ ":" DT_STRINGIFY(__LINE__)); |
Definition at line 104 of file pixelpipe_cache_alloc.h.
Allocate aligned memory tracked by the pixelpipe cache. This allows LRU cache entries to be evicted if needed to make room.
| cache | Pixelpipe cache to manage. |
| size | Buffer size in bytes. |
| id | Pipeline type owning the buffer. |
| name | Human-readable name. |
Definition at line 1919 of file pixelpipe_cache.c.
References _arena_alloc_with_defrag(), _free_space_to_alloc(), _log_arena_allocation_failure(), _non_thread_safe_cache_ref_count_entry(), _pixelpipe_cache, dt_pixel_cache_entry_t::age, dt_dev_pixelpipe_cache_t::arena, dt_pixel_cache_entry_t::data, dt_cache_arena_free(), DT_CACHELINE_BYTES, dt_pixel_cache_new_entry(), dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), error(), dt_pixel_cache_entry_t::external_alloc, dt_dev_pixelpipe_cache_t::external_entries, FALSE, IS_NULL_PTR, L, dt_dev_pixelpipe_cache_t::lock, name, size, and TRUE.
Referenced by dt_drawlayer_cache_alloc_temp_buffer(), and dt_pixelpipe_cache_alloc_perthread_impl().
|
inlinestatic |
Definition at line 142 of file pixelpipe_cache_alloc.h.
References dt_pixelpipe_cache_alloc_perthread_impl(), L, and n.
|
inlinestatic |
Definition at line 112 of file pixelpipe_cache_alloc.h.
References DT_CACHELINE_BYTES, dt_get_num_openmp_threads(), dt_pixelpipe_cache_alloc_align_cache_impl(), IS_NULL_PTR, L, and n.
Referenced by dt_pixelpipe_cache_alloc_perthread_float_impl(), and dt_pixelpipe_cache_calloc_perthread_impl().
|
inlinestatic |
Definition at line 128 of file pixelpipe_cache_alloc.h.
References dt_get_num_openmp_threads(), dt_pixelpipe_cache_alloc_perthread_impl(), IS_NULL_PTR, L, and n.
Free aligned memory allocated with dt_pixelpipe_cache_alloc_align_cache.
| cache | Pixelpipe cache to manage. |
| mem | Pointer to the buffer pointer. Set to NULL on successful free. |
Definition at line 1968 of file pixelpipe_cache.c.
References _non_thread_safe_cache_ref_count_entry(), _non_threadsafe_cache_get_entry(), _pixelpipe_cache, dt_pthread_mutex_lock(), dt_pthread_mutex_unlock(), dt_pixel_cache_entry_t::external_alloc, dt_dev_pixelpipe_cache_t::external_entries, FALSE, dt_pixel_cache_entry_t::hash, IS_NULL_PTR, L, and dt_dev_pixelpipe_cache_t::lock.
Referenced by dt_drawlayer_cache_free_temp_buffer(), and dt_drawlayer_cache_patch_clear().