From 7ceb4c34a73084f3e72ebb790e499d2bb39d4d48 Mon Sep 17 00:00:00 2001 From: "John M. Penn" <john.m.penn@nasa.gov> Date: Wed, 3 Apr 2024 12:17:41 -0500 Subject: [PATCH] In MemoryManager change delete_var(const char*) to delete_var(std::string) --- include/trick/MemoryManager.hh | 4 ++-- .../sim_services/MemoryManager/MemoryManager_delete_var.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/trick/MemoryManager.hh b/include/trick/MemoryManager.hh index 6f98c8ad..8227f568 100644 --- a/include/trick/MemoryManager.hh +++ b/include/trick/MemoryManager.hh @@ -309,7 +309,7 @@ namespace Trick { @param var_name - the address of the variable. @return 0 = SUCCESS, 1 = FAILURE */ - int delete_var(const char* var_name); + int delete_var(std::string var_name); /** Forget about the external variable at the given address. DOES NOT attempt to deallocate the @@ -325,7 +325,7 @@ namespace Trick { @param var_name - the address of the external variable. @return 0 = SUCCESS, 1 = FAILURE */ - int delete_extern_var(const char* var_name); + int delete_extern_var(std::string var_name); /** Checkpoint all allocations known to the MemoryManager to the given stream. diff --git a/trick_source/sim_services/MemoryManager/MemoryManager_delete_var.cpp b/trick_source/sim_services/MemoryManager/MemoryManager_delete_var.cpp index cd5a17f8..4bde1c45 100644 --- a/trick_source/sim_services/MemoryManager/MemoryManager_delete_var.cpp +++ b/trick_source/sim_services/MemoryManager/MemoryManager_delete_var.cpp @@ -110,7 +110,7 @@ int Trick::MemoryManager::delete_var(void* address ) { } // MEMBER FUNCTION -int Trick::MemoryManager::delete_var( const char* name) { +int Trick::MemoryManager::delete_var( std::string name) { VARIABLE_MAP::iterator pos; ALLOC_INFO *alloc_info; @@ -140,7 +140,7 @@ int Trick::MemoryManager::delete_extern_var( void* address) { } // MEMBER FUNCTION -int Trick::MemoryManager::delete_extern_var( const char* name) { +int Trick::MemoryManager::delete_extern_var( std::string name) { // delete_var will remove the external variable from the allocation map return delete_var(name) ; }