Skip to content

Commit

Permalink
Add in a more helpful usage message to allocator_tutorial. (#409)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette authored and mjcarroll committed Nov 15, 2019
1 parent b10f45c commit 2793f36
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions demo_nodes_cpp/src/topics/allocator_tutorial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ int main(int argc, char ** argv)
std::list<std::string> 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) {
Expand Down

0 comments on commit 2793f36

Please sign in to comment.