-/*****************************************************************************\
-* *
-* Name : static_memory_gremlin *
-* Author : Chris Koeritz *
-* *
-*******************************************************************************
-* Copyright (c) 2004-$now By Author. This program is free software; you can *
-* redistribute it and/or modify it under the terms of the GNU General Public *
-* License as published by the Free Software Foundation; either version 2 of *
-* the License or (at your option) any later version. This is online at: *
-* http://www.fsf.org/copyleft/gpl.html *
-* Please send any updates to: fred@gruntose.com *
-\*****************************************************************************/
+/*
+* Name : static_memory_gremlin
+* Author : Chris Koeritz
+*
+* Copyright (c) 2004-$now By Author. This program is free software; you can
+* redistribute it and/or modify it under the terms of the GNU General Public
+* License as published by the Free Software Foundation; either version 2 of
+* the License or (at your option) any later version. This is online at:
+* http://www.fsf.org/copyleft/gpl.html
+* Please send any updates to: fred@gruntose.com
+*/
#include "static_memory_gremlin.h"
: c_lock(),
c_top_index(0),
c_actual_size(0),
- c_pointers(NIL),
+ c_pointers(NULL_POINTER),
c_show_debugging(false)
{
ensure_space_exists();
// could be added on the end of the list as a result of this destruction.
int zapped_index = c_top_index - 1;
gremlin_object_record *ptr = c_pointers[zapped_index];
- c_pointers[zapped_index] = NIL;
+ c_pointers[zapped_index] = NULL_POINTER;
// since we know the one we're zapping, we no longer need that index.
c_top_index--;
// this should allow us to keep chewing on items that are newly being
}
#endif
delete [] c_pointers;
- c_pointers = NIL;
+ c_pointers = NULL_POINTER;
}
bool static_memory_gremlin::__program_is_dying() { return __global_program_is_dying; }
{
auto_synchronizer l(c_lock);
int indy = locate(unique_name);
- if (negative(indy)) return NIL;
+ if (negative(indy)) return NULL_POINTER;
return c_pointers[indy]->c_object;
}
if (ptr == c_pointers[i]->c_object)
return c_pointers[i]->c_name;
}
- return NIL;
+ return NULL_POINTER;
}
bool static_memory_gremlin::put(const char *unique_name, root_object *to_put)
if (!new_ptr) {
throw "error: static_memory_gremlin::ensure_space_exists: failed to allocate memory for pointer list";
}
- for (int i = 0; i < c_actual_size; i++) new_ptr[i] = NIL;
+ for (int i = 0; i < c_actual_size; i++) new_ptr[i] = NULL_POINTER;
for (int j = 0; j < c_actual_size - SMG_CHUNKING_FACTOR; j++)
new_ptr[j] = c_pointers[j];
if (c_pointers) delete [] c_pointers;
static_memory_gremlin &static_memory_gremlin::__hoople_globals()
{
static bool _initted = false; // tells whether we've gone through yet.
- static static_memory_gremlin *_internal_gremlin = NIL;
+ static static_memory_gremlin *_internal_gremlin = NULL_POINTER;
// holds our list of shared pieces...
if (!_initted) {