Parameters for the HVD cache instance. More...
#include "hvdcache.h"
Data Fields | |
size_t | size |
The size of this structure. | |
const uint8 * | cache_id |
HVD cache ID for this cache. | |
const uint8 * | setup_id |
HVD_cache_policy | cache_policy |
Caching purging policy. | |
HVD_element_release_fn * | element_release_fn |
HVD_raster_release_fn * | raster_release_fn |
HVD_recovery_filter_fn * | recovery_filter_fn |
HVD_raster_purge_fn * | raster_purge_fn |
sw_memory_instance * | mem |
Memory allocation/deallocation functions. | |
Parameters for the HVD cache instance.
HVD_element_release_fn* HVD_cache_params::element_release_fn |
A function to call when an element is destroyed. This is called after destroying all rasters attached to the element.
[in] | pElement | The element which the element handle was attached to. |
[in] | helement | Data attached to the element using HVD_element_set_data(). |
HVD_raster_purge_fn* HVD_cache_params::raster_purge_fn |
A function to compress or purge data from rasters when running low on cache memory. This is called for each raster attached to an element. If not enough memory can be recovered by purging the top candidate elements, they will be released.
[in] | pElement | The element which the raster handle was attached to. |
[in] | hraster | A raster handle previously passed to HVD_element_add_raster(). |
[in,out] | recover | A location where the amount of memory the purge operation still needs to recover is stored. On exit, the raster purge function should update this to the amount that is still needed after compressing, purging to storage, or otherwise reducing memory consumption. The reduction in memory may exceed the amount needed, in which case the raster purge function should set *recover to zero on exit. |
The purge function, if present, may be called while an element is locked. It must not discard raster data, but may make it slower to access.
HVD_raster_release_fn* HVD_cache_params::raster_release_fn |
A function to call when an element with attached rasters is destroyed. This is called for each raster attached to the element.
[in] | pElement | The element which the raster handle was attached to. |
[in] | hraster | A raster handle previously passed to HVD_element_add_raster(). |
HVD_recovery_filter_fn* HVD_cache_params::recovery_filter_fn |
A function to filter rasters to those suitable for compression or eviction when running low on memory. If this parameter is NULL, then all elements and rasters will be considered eligible for all low memory calls.
[in] | pElement | The element that might be removed from the cache. |
[in] | reason | The reason supplied to the call to HVD_cache_size() or HVD_cache_recover(). This parameter may be used to exclude elements or rasters from low-memory recovery, if they do not contribute to the type of memory requested. |
TRUE | The HVD raster is eligible for purging or removal. |
FALSE | The HVD raster is not eligible for purging or removal. |
const uint8* HVD_cache_params::setup_id |
The setup ID for the cache instance. If this is an empty string, it will not match any existing cache instance. This guarantees that all elements are deleted when the connection is disconnected.