static_memory_gremlin.cpp File Reference

#include "static_memory_gremlin.h"
#include <basis/array.cpp>
#include <basis/byte_array.h>
#include <basis/function.h>
#include <basis/guards.h>
#include <basis/mutex.h>
#include <basis/object_base.h>
#include <basis/set.cpp>
#include <stdio.h>
#include <loggers/file_logger.h>
#include <loggers/locked_logger.h>
#include <loggers/null_logger.h>

Include dependency graph for static_memory_gremlin.cpp:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define static_class_name()   "static_memory_gremlin"

Functions

bool DATA_STRUCTURE_FUNCTION_STYLE program_is_dying ()
 Reports whether the program is shutting down currently.
const char DATA_STRUCTURE_FUNCTION_STYLE * EXCEPTION_INFO_FOR_SHUTTING_DOWN ()
 exception string thrown for usage errors.
const byte_array BASIS_EXTERN & __byte_array_empty_array ()
 externally stored version of byte_array::empty_array.
const istring BASIS_EXTERN & __istring_empty_string ()
 externally stored version of istring::empty_string.
static_memory_gremlinHOOPLE_GLOBALS ()
 Holds onto objects that have been allocated in a program-wide scope.
mutex__memory_gremlin_synchronizer ()
 Internally used synchronization--not for outsiders.
int_set BASIS_EXTERN & __our_kids ()
mutex BASIS_EXTERN & __uptime_synchronizer ()
mutex BASIS_EXTERN & __process_synchronizer ()

Variables

const char * _EXCEPTION_INFO_FOR_SHUTTING_DOWN = "Function must return immediately because program is shutting down."
const int SMG_CHUNKING_FACTOR = 32


Define Documentation

 
#define static_class_name (  )     "static_memory_gremlin"

Definition at line 36 of file static_memory_gremlin.cpp.


Function Documentation

const byte_array BASIS_EXTERN& __byte_array_empty_array (  ) 

externally stored version of byte_array::empty_array.

Definition at line 59 of file static_memory_gremlin.cpp.

Referenced by byte_array::empty_array().

const istring BASIS_EXTERN& __istring_empty_string (  ) 

externally stored version of istring::empty_string.

Definition at line 65 of file static_memory_gremlin.cpp.

Referenced by istring::empty_string().

mutex& __memory_gremlin_synchronizer (  ) 

Internally used synchronization--not for outsiders.

This is a very low level, private function that should not be invoked by the average user of the libraries. it is critical that it not be mis- used because a deadlock could result if it is used improperly. it returns a statically allocated mutex that can be used for the proper synchronization of our memory allocation manager. this particular function must be invoked at least once from the main thread before any other threads have been spawned. this ensures that all threads are seeing the same lock. this mutex is NOT to be used for anything other than securing static object creations from race conditions.

Definition at line 416 of file static_memory_gremlin.cpp.

References static_memory_gremlin::get(), HOOPLE_GLOBALS(), and static_memory_gremlin::put().

Referenced by library_wide_cleanup::library_wide_cleanup().

int_set BASIS_EXTERN& __our_kids (  ) 

Definition at line 429 of file static_memory_gremlin.cpp.

References SAFE_STATIC_IMPLEMENTATION.

Referenced by portable::exiting_child_signal_handler(), and portable::launch_process().

mutex BASIS_EXTERN& __process_synchronizer (  ) 

Definition at line 435 of file static_memory_gremlin.cpp.

References SAFE_STATIC_IMPLEMENTATION.

Referenced by portable::exiting_child_signal_handler(), and portable::launch_process().

mutex BASIS_EXTERN& __uptime_synchronizer (  ) 

Definition at line 432 of file static_memory_gremlin.cpp.

References SAFE_STATIC_IMPLEMENTATION.

Referenced by portable::rolling_uptime(), and portable::system_uptime().

const char DATA_STRUCTURE_FUNCTION_STYLE* EXCEPTION_INFO_FOR_SHUTTING_DOWN (  ) 

exception string thrown for usage errors.

this string will be thrown as an exception if a program is trying to use global objects when it should be shutting down instead.

Definition at line 56 of file static_memory_gremlin.cpp.

References _EXCEPTION_INFO_FOR_SHUTTING_DOWN.

static_memory_gremlin& HOOPLE_GLOBALS (  ) 

Holds onto objects that have been allocated in a program-wide scope.

These objects will have a lifetime up to the point of normal static object destruction and then they will be cleaned up.

Definition at line 228 of file static_memory_gremlin.cpp.

References __argv, FUNCDEF, NIL, and program_wide_memories.

Referenced by __memory_gremlin_synchronizer(), and program_wide_cleanup::~program_wide_cleanup().

bool DATA_STRUCTURE_FUNCTION_STYLE program_is_dying (  ) 

Reports whether the program is shutting down currently.

If this flag is true, then code should generally just return without doing anything where possible. It's especially important for long running loops or active threads to stop if they see this, although the normal program exit processes usually make it unnecessary.

Definition at line 54 of file static_memory_gremlin.cpp.

Referenced by static_memory_gremlin::~static_memory_gremlin().


Variable Documentation

const char* _EXCEPTION_INFO_FOR_SHUTTING_DOWN = "Function must return immediately because program is shutting down."

Definition at line 48 of file static_memory_gremlin.cpp.

Referenced by EXCEPTION_INFO_FOR_SHUTTING_DOWN().

const int SMG_CHUNKING_FACTOR = 32

Definition at line 73 of file static_memory_gremlin.cpp.

Referenced by static_memory_gremlin::ensure_space_exists().


Generated on Fri Aug 29 04:29:41 2008 for HOOPLE Libraries by  doxygen 1.5.1