summaryrefslogtreecommitdiff
path: root/contrib/examples/example_app/lwippools.h
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-10-16 08:10:14 -0600
committerTom Rini <trini@konsulko.com>2024-10-16 08:10:14 -0600
commitf3f86fd1fe0fb288356bff78f8a6fa2edf89e3fc (patch)
treef0a99ea87d92f63895a6d053e3185838ebecf2d0 /contrib/examples/example_app/lwippools.h
Squashed 'lib/lwip/lwip/' content from commit 0a0452b2c39b
git-subtree-dir: lib/lwip/lwip git-subtree-split: 0a0452b2c39bdd91e252aef045c115f88f6ca773
Diffstat (limited to 'contrib/examples/example_app/lwippools.h')
-rw-r--r--contrib/examples/example_app/lwippools.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/contrib/examples/example_app/lwippools.h b/contrib/examples/example_app/lwippools.h
new file mode 100644
index 00000000000..f58aa598117
--- /dev/null
+++ b/contrib/examples/example_app/lwippools.h
@@ -0,0 +1,20 @@
+/* OPTIONAL: Pools to replace heap allocation
+ * Optional: Pools can be used instead of the heap for mem_malloc. If
+ * so, these should be defined here, in increasing order according to
+ * the pool element size.
+ *
+ * LWIP_MALLOC_MEMPOOL(number_elements, element_size)
+ */
+#if MEM_USE_POOLS
+LWIP_MALLOC_MEMPOOL_START
+LWIP_MALLOC_MEMPOOL(100, 256)
+LWIP_MALLOC_MEMPOOL(50, 512)
+LWIP_MALLOC_MEMPOOL(20, 1024)
+LWIP_MALLOC_MEMPOOL(20, 1536)
+LWIP_MALLOC_MEMPOOL_END
+#endif /* MEM_USE_POOLS */
+
+/* Optional: Your custom pools can go here if you would like to use
+ * lwIP's memory pools for anything else.
+ */
+LWIP_MEMPOOL(SYS_MBOX, 22, 100, "SYS_MBOX")