diff options
author | Pixel <pixel@nobis-crew.org> | 2011-10-03 14:48:05 -0700 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2011-10-03 14:48:05 -0700 |
commit | 342b273234405ab76dc159d2e402bfb1ddfa1d8f (patch) | |
tree | f10d6857960313d6fc3b0aaa325ed46b8ad481fb /src/Local.cc |
First commit - very basic features.
Diffstat (limited to 'src/Local.cc')
-rw-r--r-- | src/Local.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Local.cc b/src/Local.cc new file mode 100644 index 0000000..1262179 --- /dev/null +++ b/src/Local.cc @@ -0,0 +1,27 @@ +#include "Local.h" +#include "Main.h" + +static void * dummyTLS = NULL; + +void * Balau::TLSManager::getTLS() { + return dummyTLS; +} + +void * Balau::TLSManager::setTLS(void * val) { + void * r = dummyTLS; + dummyTLS = val; + return r; +} + +static Balau::TLSManager dummyTLSManager; +Balau::TLSManager * Balau::tlsManager = &dummyTLSManager; + +int Balau::Local::s_size = 0; +void ** Balau::Local::m_globals = 0; + +void Balau::Local::doStart() { + Assert(Main::status() == Main::STARTING); + m_idx = s_size++; + m_globals = reinterpret_cast<void **>(realloc(m_globals, s_size * sizeof(void *))); + m_globals[m_idx] = 0; +} |