From 66ecce7bedcd8fa2de7f450c5f784d257adf4efa Mon Sep 17 00:00:00 2001 From: Razvan Becheriu Date: Tue, 30 Jun 2020 17:58:08 +0300 Subject: [PATCH] [#1282] updated documentation --- src/lib/hooks/hooks_user.dox | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/lib/hooks/hooks_user.dox b/src/lib/hooks/hooks_user.dox index 4c5c5814f1..d7d2cc6b10 100644 --- a/src/lib/hooks/hooks_user.dox +++ b/src/lib/hooks/hooks_user.dox @@ -1535,24 +1535,23 @@ pointers between the two memory spaces with at least two bad consequences when they are not correctly managed: - Kea uses shared pointers for its objects. If the hook ownership keeps -ownership of an object this object will be never destroyed leading to -a trivial memory leak. Some care is recommended when the the hook library +ownership of an object, this object will never be destroyed, leading to +a trivial memory leak. Some care is recommended when the hook library uses a garbage collector to not postpone releases of no longer used -objects. Cycles should be avoided too for instance using weak pointers. -Of course at the opposite if a Kea object is needed ownership on it must +objects. Cycles should be avoided too, for instance using weak pointers. +Of course at the opposite, if a Kea object is needed ownership on, it must be kept in order to not get a dangling pointer when it will be destroyed at the end of its last reference lifetime. -- Kea can take some pointers to the hook library memory space for instance +- Kea can take some pointers to the hook library memory space, for instance when a hook object is registered. If these pointers are not destroyed before the hook library memory space is unmapped by dlclose() this likely leads to a crash. Communication between Kea code and hook library code is provided by -callout handles. For callout points related to a packet the callout -handle is associated with the packet, this allows for instance to -get the same callout handle for all callout points called during -processing of a query. +callout handles. For callout points related to a packet, the callout +handle is associated with the packet allowing to get the same callout handle +for all callout points called during processing of a query. Hook libraries are closed i.e. hook library memory spaces are unmapped only when there is no active callout handles. This enforces a correct -- 2.47.2