summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2019-06-19 08:16:22 +0200
committerDavid Lamparter <equinox@diac24.net>2019-06-21 08:54:25 +0200
commit056830ba69eb2e513e9148c6e914e1353a556790 (patch)
treea7337ec59c824cf6ae505441ffea274335ce5b66 /doc
parentMerge pull request #4545 from nitinsoniism/show_evpn_mac_vni_seq_number (diff)
downloadfrr-056830ba69eb2e513e9148c6e914e1353a556790.tar.xz
frr-056830ba69eb2e513e9148c6e914e1353a556790.zip
lib: improve MTYPE definitions
The "static struct mtype * const MTYPE_FOO" doesn't quite make a "constant" that is usable for initializers. An 1-element array works better. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'doc')
-rw-r--r--doc/developer/memtypes.rst10
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/developer/memtypes.rst b/doc/developer/memtypes.rst
index 153131bab..13f6b43bb 100644
--- a/doc/developer/memtypes.rst
+++ b/doc/developer/memtypes.rst
@@ -42,6 +42,16 @@ Example:
Definition
----------
+.. c:type:: struct memtype
+
+ This is the (internal) type used for MTYPE definitions. The macros below
+ should be used to create these, but in some cases it is useful to pass a
+ ``struct memtype *`` pointer to some helper function.
+
+ The ``MTYPE_name`` created by the macros is declared as an array, i.e.
+ a function taking a ``struct memtype *`` argument can be called with an
+ ``MTYPE_name`` argument (as opposed to ``&MTYPE_name``.)
+
.. c:macro:: DECLARE_MGROUP(name)
This macro forward-declares a memory group and should be placed in a