Skip to content

Commit 611f686

Browse files
committed
Unify description and close handle
1 parent 8e6f090 commit 611f686

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

libCacheSim/cache/eviction/plugin_cache.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ extern "C" {
4747
*/
4848
typedef struct pluginCache_params {
4949
char *plugin_path; ///< Path to the plugin shared library
50-
void *handle; ///< Handle to the loaded plugin library
50+
void *plugin_handle; ///< Handle to the loaded plugin library
5151
void *data; ///< Plugin's internal data structure
5252
cache_init_hook_t cache_init_hook; ///< Plugin initialization function
5353
cache_hit_hook_t cache_hit_hook; ///< Cache hit handler function
@@ -140,7 +140,7 @@ cache_t *pluginCache_init(const common_cache_params_t ccache_params,
140140
ERROR("Failed to load plugin %s: %s\n", params->plugin_path, dlerror());
141141
exit(1);
142142
}
143-
params->handle = handle;
143+
params->plugin_handle = handle;
144144

145145
// Load hook functions from the plugin using unions to avoid pedantic warnings
146146
union {
@@ -218,8 +218,8 @@ static void pluginCache_free(cache_t *cache) {
218218
pluginCache_params_t *params = (pluginCache_params_t *)cache->eviction_params;
219219

220220
if (params->cache_free_hook != NULL) params->cache_free_hook(params->data);
221-
if (params->handle != NULL)
222-
dlclose(params->handle); // Close the plugin shared library handle
221+
if (params->plugin_handle != NULL)
222+
dlclose(params->plugin_handle); // Close the plugin shared library handle
223223
if (params->plugin_path != NULL) free(params->plugin_path);
224224
if (params->cache_name != NULL) free(params->cache_name);
225225
free(cache->eviction_params);

libCacheSim/include/libCacheSim/plugin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ typedef void (*cache_remove_hook_t)(void *data, const obj_id_t obj_id);
190190
/**
191191
* @brief Cache free hook function type
192192
*
193-
* Optional cleanup function called when the cache is being destroyed.
193+
* Cleanup function called when the cache is being destroyed.
194194
* The plugin should free any resources allocated in cache_init_hook.
195195
*
196196
* @param data Pointer to plugin's internal data (from cache_init_hook)

0 commit comments

Comments
 (0)