]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cleanup: Place explicit size on ref-count lock counter
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 29 Mar 2015 04:22:08 +0000 (21:22 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 29 Mar 2015 04:22:08 +0000 (21:22 -0700)
This allows us to make explicit calculation of child object sizes in a
portable way despite differences in system 'unsigned' size.

src/base/Lock.h

index d81d793619f42887ea933e794fff7417a515f6fc..33eb51a3df7e4aa3f499b65a9f5bf91b43b07990 100644 (file)
@@ -40,7 +40,7 @@ public:
 
     /// Clear one lock / reference against this object.
     /// All locks must be cleared before it may be destroyed.
-    unsigned unlock() const {
+    uint32_t unlock() const {
 #if defined(LOCKCOUNT_DEBUG)
         old_debug(0,1)("Decrementing this %p from count %u\n",this,count_);
 #endif
@@ -49,10 +49,10 @@ public:
     }
 
     /// Inspect the current count of references.
-    unsigned LockCount() const { return count_; }
+    uint32_t LockCount() const { return count_; }
 
 private:
-    mutable unsigned count_; ///< number of references currently being tracked
+    mutable uint32_t count_; ///< number of references currently being tracked
 };
 
 // For clarity we provide some aliases for the tracking mechanisms