From a3b407ecc73f8da8df060b34c20d772e58a33955 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Thu, 24 Oct 2019 22:22:16 +0000 Subject: [PATCH] Add in a more helpful usage message to allocator_tutorial. Signed-off-by: Chris Lalancette --- demo_nodes_cpp/src/topics/allocator_tutorial.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/demo_nodes_cpp/src/topics/allocator_tutorial.cpp b/demo_nodes_cpp/src/topics/allocator_tutorial.cpp index 79b664a46..2f2e14a72 100644 --- a/demo_nodes_cpp/src/topics/allocator_tutorial.cpp +++ b/demo_nodes_cpp/src/topics/allocator_tutorial.cpp @@ -143,6 +143,14 @@ int main(int argc, char ** argv) std::list keys = {"intra", "intraprocess", "intra-process", "intra_process"}; bool intra_process = false; + printf("This simple demo shows off a custom memory allocator to count all\n" + "instances of new/delete in the program. It can be run in either regular\n" + "mode (no arguments), or in intra-process mode (by passing 'intra' as a\n" + "command-line argument)'. It will then publish a message to the\n" + "'/allocator_tutorial' topic every 10 milliseconds until Ctrl-C is pressed.\n" + "At that time it will print a count of the number of allocations and\n" + "deallocations that happened during the program.\n\n"); + if (argc > 1) { for (auto & key : keys) { if (std::string(argv[1]) == key) {