summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/client/client.c
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2020-09-30 10:43:00 +0200
committerOle Troan <ot@cisco.com>2020-10-07 12:46:08 +0200
commit65fa036ec71b9b111b22802a69a83af2798ea10e (patch)
treede2b3de644c1b2b6c8b540d5076aaeafa4c9e775 /src/vpp-api/client/client.c
parent1f36023d29137825b8a09578d09b955046c2415b (diff)
api: add heap alloc to vpp stats
The Python VPP Stats module also used the VPP heap. Fix so it now explicitly allocates a heap. Fixes: f68fccfe7e188fec2c9f91da38ca9acf6f67d811 Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I0bd4ae64d6c89cdf634d8d9a91c23ab38017c5cc Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vpp-api/client/client.c')
-rw-r--r--src/vpp-api/client/client.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vpp-api/client/client.c b/src/vpp-api/client/client.c
index 0d7b1dcafc8..2127a62269f 100644
--- a/src/vpp-api/client/client.c
+++ b/src/vpp-api/client/client.c
@@ -79,6 +79,9 @@ u16 read_timeout = 0;
bool rx_is_running = false;
bool timeout_thread_cancelled = false;
+/* Only ever allocate one heap */
+bool mem_initialized = false;
+
static void
init (void)
{
@@ -564,8 +567,11 @@ vac_set_error_handler (vac_error_callback_t cb)
void
vac_mem_init (size_t size)
{
+ if (mem_initialized)
+ return;
if (size == 0)
clib_mem_init (0, 1 << 30); // default
else
clib_mem_init (0, size);
+ mem_initialized = true;
}