summaryrefslogtreecommitdiff
path: root/common_modules/module_manager/src
diff options
context:
space:
mode:
authorFrédéric Desbiens <[email protected]>2026-07-27 10:30:29 -0400
committerGitHub <[email protected]>2026-07-27 10:30:29 -0400
commit92ce0754ed42f9d9d1121805057db5cc9c171d66 (patch)
tree36c16c1919c2fcf164f0774f25956f5875278db2 /common_modules/module_manager/src
parentd2de89df189f15de7539782b61e6e78f0bb03641 (diff)
Marked txm_module_object_deallocate as deprecated (#559)
Added a compile-time #pragma message warning to the module library source so that any module that includes or compiles this file receives an explicit deprecation notice at build time. Updated the internal documentation block in the manager-side implementation to explain that this function must not be called directly and that calling it on a live object causes a use-after-free. The Module Manager dispatch layer already releases pool memory automatically after a successful tx_*_delete() call. Module authors should remove any explicit call to txm_module_object_deallocate(). Co-authored-by: Copilot <[email protected]>
Diffstat (limited to 'common_modules/module_manager/src')
-rw-r--r--common_modules/module_manager/src/txm_module_manager_object_deallocate.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/common_modules/module_manager/src/txm_module_manager_object_deallocate.c b/common_modules/module_manager/src/txm_module_manager_object_deallocate.c
index 2efc465b..95e28e4d 100644
--- a/common_modules/module_manager/src/txm_module_manager_object_deallocate.c
+++ b/common_modules/module_manager/src/txm_module_manager_object_deallocate.c
@@ -38,7 +38,17 @@
/* */
/* DESCRIPTION */
/* */
-/* This function deallocates a previously allocated object. */
+/* DEPRECATED. This function is called internally by the Module */
+/* Manager dispatch layer after a successful tx_*_delete() call from */
+/* a module. It must not be called directly by module or application */
+/* code. Calling it on a live kernel object (one whose tx_*_delete() */
+/* has not yet been called) frees the backing pool memory while the */
+/* object is still referenced by the kernel (use-after-free). */
+/* */
+/* Module authors: remove any explicit call to */
+/* txm_module_object_deallocate(). Calling the appropriate */
+/* tx_*_delete() service is sufficient; pool deallocation is handled */
+/* automatically by the dispatch layer. */
/* */
/* INPUT */
/* */