aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorJoão Valverde <j@v6e.pt>2021-07-26 01:31:17 +0100
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-07-26 14:56:11 +0000
commit133b0c583f0d365175284a94c9b5411d62e3e5b9 (patch)
tree3ce5db3a1b697aa225262ed3fcfe1b78292c8e46 /doc
parent7f9c1f5f92c131354fc8b2b88d473706786064c0 (diff)
Move epan/wmem/wmem_scopes.h to epan/
This header was installed incorrectly to epan/wmem_scopes.h. Instead of creating additional installation rules for a single header in a subfolder (kept for backward compatibility) just rename the standard "epan/wmem/wmem.h" include to "epan/wmem_scopes.h" and fix the documentation. Now the header is installed *correctly* to epan/wmem_scopes.h.
Diffstat (limited to 'doc')
-rw-r--r--doc/README.request_response_tracking4
-rw-r--r--doc/README.wmem16
2 files changed, 9 insertions, 11 deletions
diff --git a/doc/README.request_response_tracking b/doc/README.request_response_tracking
index 1081c4d5e8..eb9886a46c 100644
--- a/doc/README.request_response_tracking
+++ b/doc/README.request_response_tracking
@@ -27,11 +27,9 @@ The example below shows how simple this is to add to the dissector IF:
The example is taken from the PANA dissector:
-First we need to include the definitions for conversations and memory
-management.
+First we need to include the definitions for conversations.
#include <epan/conversation.h>
- #include <epan/wmem/wmem.h>
Then we also need a few header fields to show the relations between request
and response as well as the response time.
diff --git a/doc/README.wmem b/doc/README.wmem
index 27a2097722..3e1e95aaef 100644
--- a/doc/README.wmem
+++ b/doc/README.wmem
@@ -5,9 +5,9 @@ the old 'emem' framework which was removed in Wireshark 2.0.
In order to make memory management easier and to reduce the probability of
memory leaks, Wireshark provides its own memory management API. This API is
-implemented inside epan/wmem/ and provides memory pools and functions that make
+implemented inside wsutil/wmem/ and provides memory pools and functions that make
it easy to manage memory even in the face of exceptions (which many dissector
-functions can raise).
+functions can raise). Memory scopes for dissection are defined in epan/wmem_scopes.h.
Correct use of these functions will make your code faster, and greatly reduce
the chances that it will leak memory in exceptional cases.
@@ -19,7 +19,7 @@ https://www.wireshark.org/lists/wireshark-dev/201210/msg00178.html
If you're writing a dissector, or other "userspace" code, then using wmem
should be very similar to using malloc or g_malloc or whatever else you're used
-to. All you need to do is include the header (epan/wmem/wmem.h) and optionally
+to. All you need to do is include the header (epan/wmem_scopes.h) and optionally
get a handle to a memory pool (if you want to *create* a memory pool, see the
section "3. Usage for Producers" below).
@@ -53,7 +53,7 @@ changed without warning.
2.2 Wireshark Global Pools
-Dissectors that include the wmem header file will have three pools available
+Dissectors that include the wmem_scopes.h header file will have three pools available
to them automatically: pinfo->pool, wmem_file_scope() and
wmem_epan_scope(); there is also a wmem_packet_scope() for cases when the
`pinfo` argument is not accessible, but pinfo->pool should be preferred.
@@ -66,7 +66,7 @@ current capture file is closed.
NB: Using these pools outside of the appropriate scope (e.g. using the file
pool when there isn't a file open) will throw an assertion.
- See the comment in epan/wmem/wmem_scopes.c for details.
+ See the comment in epan/wmem_scopes.c for details.
The epan pool is scoped to the library's lifetime - memory allocated in it is
not freed until epan_cleanup() is called, which is typically but not necessarily
@@ -170,7 +170,7 @@ To create a pool, include the regular wmem header and call the
wmem_allocator_new() function with the appropriate type value.
For example:
- #include "wmem/wmem.h"
+ #include <wsutil/wmem/wmem.h>
wmem_allocator_t *myPool;
myPool = wmem_allocator_new(WMEM_ALLOCATOR_SIMPLE);
@@ -186,7 +186,7 @@ document.
Regardless of which allocator you used to create a pool, it can be destroyed
with a call to the function wmem_destroy_allocator(). For example:
- #include "wmem/wmem.h"
+ #include <wsutil/wmem/wmem.h>
wmem_allocator_t *myPool;
@@ -206,7 +206,7 @@ allowing it to be reused later. Depending on the type of allocator, doing this
and recreating the pool. This method is therefore recommended, especially when
the pool would otherwise be scoped to a single iteration of a loop. For example:
- #include "wmem/wmem.h"
+ #include <wsutil/wmem/wmem.h>
wmem_allocator_t *myPool;