![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "caches/pixelpipe_cache.h"#include "system/atomic.h"#include <stdarg.h>#include <stddef.h>#include <setjmp.h>#include <stdint.h>#include <cmocka.h>#include "win/main_wrapper.h"
Include dependency graph for test_pipe_cache_flush.c:Go to the source code of this file.
Macros | |
| #define | LINE_BYTES (256 * 1024) |
| #define | HASH_A 0x0A0A0A0A0A0A0A0Aull |
Functions | |
| static int | _setup (void **state __attribute__((unused))) |
| static int | _teardown (void **state __attribute__((unused))) |
| static dt_pixel_cache_entry_t * | _create_held (void) |
| static void | _held_line_survives_the_flush (void **state __attribute__((unused))) |
| static void | _released_line_goes_with_the_flush (void **state __attribute__((unused))) |
| int | main (int argc, char *argv[]) |
| #define HASH_A 0x0A0A0A0A0A0A0A0Aull |
Definition at line 44 of file test_pipe_cache_flush.c.
| #define LINE_BYTES (256 * 1024) |
A flush frees nothing somebody holds.
A backbuffer keepalive, or a module keeping its preview across runs, holds a reference and no lock. The flush used to spare locked lines only: it freed a held one, and the holder's release then decremented freed memory (issue #1546).
These tests drive the cache alone, without a pipe: the contract is the cache's.
Definition at line 43 of file test_pipe_cache_flush.c.
|
static |
Definition at line 58 of file test_pipe_cache_flush.c.
References dt_dev_pixelpipe_cache_get(), dt_dev_pixelpipe_cache_wrlock_entry(), FALSE, HASH_A, LINE_BYTES, and TRUE.
Referenced by _held_line_survives_the_flush(), and _released_line_goes_with_the_flush().
Held through the flush: the line stays, with its reference, and its holder releases it safely.
Definition at line 70 of file test_pipe_cache_flush.c.
References _create_held(), dt_atomic_get_int(), dt_dev_pixelpipe_cache_flush(), dt_dev_pixelpipe_cache_get_entry(), dt_dev_pixelpipe_cache_unref_entry(), HASH_A, and dt_pixel_cache_entry_t::refcount.
Referenced by main().
Released, the same line goes with the next flush: the guard spares holders, not lines.
Definition at line 82 of file test_pipe_cache_flush.c.
References _create_held(), dt_dev_pixelpipe_cache_flush(), dt_dev_pixelpipe_cache_get_entry(), dt_dev_pixelpipe_cache_unref_entry(), and HASH_A.
Referenced by main().
Definition at line 46 of file test_pipe_cache_flush.c.
References dt_dev_pixelpipe_cache_init(), and FALSE.
Referenced by main().
Definition at line 51 of file test_pipe_cache_flush.c.
References dt_dev_pixelpipe_cache_cleanup().
Referenced by main().
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Definition at line 91 of file test_pipe_cache_flush.c.
References _held_line_survives_the_flush(), _released_line_goes_with_the_flush(), _setup(), and _teardown().