Skip to content

Commit d6a428e

Browse files
authored
Add description for cache_free_hook
For some experimental situations where memory safety is not required, the "cache_free_hook" can be skipped.
1 parent 62f13cb commit d6a428e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

doc/quickstart_plugin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Your library **must** export the following C-symbols:
3131
| `cache_eviction_hook` | `obj_id_t cache_eviction_hook(void *data, const request_t *req);` | Cache is full – must return the object-ID to evict. |
3232
| `cache_remove_hook` | `void cache_remove_hook(void *data, const obj_id_t obj_id);` | An object is explicitly removed (not necessarily due to eviction). |
3333

34-
The opaque pointer returned by `cache_init_hook` is passed back to every other hook via the `data` parameter, letting your plugin maintain arbitrary state (linked lists, hash maps, statistics, …).
34+
The opaque pointer returned by `cache_init_hook` is passed back to every other hook via the `data` parameter, letting your plugin maintain arbitrary state (linked lists, hash maps, statistics, …). For memory safety, your library can export `cache_free_hook` to free the resources used by your cache struct according to your demands.
3535

3636
---
3737

0 commit comments

Comments
 (0)