Move the message for internal::RaiseUseAfterFree to the implementation.
authorRobert Sesek <rsesek@bluestatic.org>
Wed, 12 Oct 2016 01:32:34 +0000 (21:32 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Wed, 12 Oct 2016 01:32:34 +0000 (21:32 -0400)
zcpointer.cc
zcpointer.h

index 4f4afdf..db39cf4 100644 (file)
@@ -19,8 +19,8 @@
 namespace zc {
 namespace internal {
 
-void RaiseUseAfterFree(const char* error) {
-  throw zc::UseAfterFreeError(error);
+void RaiseUseAfterFree() {
+  throw zc::UseAfterFreeError("attempt to access deleted pointer");
 }
 
 }  // namespace internal
index 74a547d..d77bb63 100644 (file)
@@ -85,7 +85,7 @@ class OwnedPtrDeleter {
   OwnershipBehavior behavior_;
 };
 
-void RaiseUseAfterFree(const char* error) __attribute__((noreturn));
+void RaiseUseAfterFree() __attribute__((noreturn));
 
 }  // namespace internal
 
@@ -171,7 +171,7 @@ class ref {
  private:
   void CheckDeleted() const {
     if (IsDeleted()) {
-      internal::RaiseUseAfterFree("attempt to access deleted pointer");
+      internal::RaiseUseAfterFree();
     }
   }