summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2004-11-25 04:18:34 +0000
committerMichi Henning <michi@zeroc.com>2004-11-25 04:18:34 +0000
commitcaa0420fca74674bf5d3862919da69cf90204b1f (patch)
tree842ef072c18f99250bf613cbcfefbac510e26261 /cpp/src/slice2cpp
parentImproved test (diff)
downloadice-caa0420fca74674bf5d3862919da69cf90204b1f.tar.bz2
ice-caa0420fca74674bf5d3862919da69cf90204b1f.tar.xz
ice-caa0420fca74674bf5d3862919da69cf90204b1f.zip
Changed IceUtil::GCShared to derive from IceUtil::Shared.
Diffstat (limited to 'cpp/src/slice2cpp')
-rw-r--r--cpp/src/slice2cpp/.depend4
-rw-r--r--cpp/src/slice2cpp/Gen.cpp9
2 files changed, 6 insertions, 7 deletions
diff --git a/cpp/src/slice2cpp/.depend b/cpp/src/slice2cpp/.depend
index 5f7454c0913..f6f33296ae8 100644
--- a/cpp/src/slice2cpp/.depend
+++ b/cpp/src/slice2cpp/.depend
@@ -1,2 +1,2 @@
-Gen.o: Gen.cpp Gen.h ../../include/Slice/Parser.h ../../include/IceUtil/Shared.h ../../include/IceUtil/Config.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/IceUtil/ThreadException.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Handle.h ../../include/IceUtil/InputUtil.h ../../include/IceUtil/OutputUtil.h ../../include/Slice/CPlusPlusUtil.h ../../include/IceUtil/Functional.h ../../include/IceUtil/Iterator.h ../../include/Slice/Checksum.h
-Main.o: Main.cpp ../../include/Slice/Preprocessor.h ../../include/IceUtil/Config.h Gen.h ../../include/Slice/Parser.h ../../include/IceUtil/Shared.h ../../include/IceUtil/Mutex.h ../../include/IceUtil/Lock.h ../../include/IceUtil/ThreadException.h ../../include/IceUtil/Exception.h ../../include/IceUtil/Handle.h ../../include/IceUtil/InputUtil.h ../../include/IceUtil/OutputUtil.h
+Gen.o: Gen.cpp Gen.h ../../include/Slice/Parser.h ../../include/IceUtil/Shared.h ../../include/IceUtil/Config.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/InputUtil.h ../../include/IceUtil/OutputUtil.h ../../include/Slice/CPlusPlusUtil.h ../../include/IceUtil/Functional.h ../../include/IceUtil/Iterator.h ../../include/Slice/Checksum.h
+Main.o: Main.cpp ../../include/Slice/Preprocessor.h ../../include/IceUtil/Config.h Gen.h ../../include/Slice/Parser.h ../../include/IceUtil/Shared.h ../../include/IceUtil/Handle.h ../../include/IceUtil/Exception.h ../../include/IceUtil/InputUtil.h ../../include/IceUtil/OutputUtil.h
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 8f49c312083..cba5e59e7ad 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -2920,8 +2920,7 @@ Slice::Gen::ObjectVisitor::emitGCFunctions(const ClassDefPtr& p)
C << sp << nl << "void" << nl << scoped.substr(2) << "::__incRef()";
C << sb;
C << nl << "IceUtil::gcRecMutex._m->lock();";
- C << nl << "assert(_ref >= 0);";
- C << nl << "if(_ref == 0)";
+ C << nl << "if(__getRefUnsafe() == 0)";
C << sb;
C.zeroIndent();
C << nl << "#ifdef NDEBUG // To avoid annoying warnings about variables that are not used...";
@@ -2936,7 +2935,7 @@ Slice::Gen::ObjectVisitor::emitGCFunctions(const ClassDefPtr& p)
C << nl << "#endif";
C.restoreIndent();
C << eb;
- C << nl << "++_ref;";
+ C << nl << "__incRefUnsafe();";
C << nl << "IceUtil::gcRecMutex._m->unlock();";
C << eb;
@@ -2946,8 +2945,8 @@ Slice::Gen::ObjectVisitor::emitGCFunctions(const ClassDefPtr& p)
C << sb;
C << nl << "IceUtil::gcRecMutex._m->lock();";
C << nl << "bool doDelete = false;";
- C << nl << "assert(_ref > 0);";
- C << nl << "if(--_ref == 0)";
+ C << nl << "__decRefUnsafe();";
+ C << nl << "if(__getRefUnsafe() == 0)";
C << sb;
C << nl << "doDelete = !_noDelete;";
C << nl << "_noDelete = true;";