Set of utilities for allocating temporary workspace.
[Teuchos Memory Management Utilities]


class  Teuchos::RawWorkspace
 Encapulsation object for raw temporary workspace that has been allocated. These objects can only be created on the stack and should not be included as the member of any other classes. More...
class  Teuchos::Workspace< T >
 Templated class for workspace creation. More...
class  Teuchos::WorkspaceStore
 Workspace encapsulation class. More...
class  Teuchos::WorkspaceStoreInitializeable
 WorkspaceStore class that can be used to actually reinitialize memory. More...


void Teuchos::set_default_workspace_store (const Teuchos::RefCountPtr< WorkspaceStore > &default_workspace_store)
 Set pointer to global workspace object.
Teuchos::RefCountPtr< WorkspaceStore > Teuchos::get_default_workspace_store ()
 Get the global workspace object set by set_default_workspace_store().
void Teuchos::print_memory_usage_stats (const WorkspaceStore *workspace_store, std::ostream &out)
 Print statistics on memory usage.

Detailed Description

The goal of this set of utilities is to allow the user to create arrays of uninitialized or default initialized objects as automatic variables on the stack to be used for temporary workspace without requiring expensive calls opeator new or operator delete.

Function Documentation

void Teuchos::set_default_workspace_store const Teuchos::RefCountPtr< WorkspaceStore > &  default_workspace_store  ) 

Set pointer to global workspace object.

This function sets a smart pointer to a workspace object can be set at any time and will serve as the default workspace. This object can serve as a single workspace that can be used by all of the functions in an entire process thread for all of its temporary workspace memory needs. By default this pointer is set to NULL and it is up to some entity to set this pointer to a valid object. If the application is to be threaded, then sharing a single Teuchos::WorkspaceStore object between threads will result in incorrect behavior and could potentially crash the program in some cases and the implementation of this set function and its corresponding get function must be modified.


Definition at line 37 of file Teuchos_Workspace.cpp.

Teuchos::RefCountPtr< Teuchos::WorkspaceStore > Teuchos::get_default_workspace_store  ) 

Get the global workspace object set by set_default_workspace_store().

Definition at line 42 of file Teuchos_Workspace.cpp.

void Teuchos::print_memory_usage_stats const WorkspaceStore *  workspace_store,
std::ostream &  out

Print statistics on memory usage.

workspace_store [in] If workspace_store!=NULL then statistics about its memory usage to this point are printed to out.
out [in/out] Stream used for printing to.

Definition at line 47 of file Teuchos_Workspace.cpp.

Generated on Thu Sep 18 12:30:31 2008 for Teuchos - Trilinos Tools Package by doxygen