diff options
Diffstat (limited to 'ace/ACE.i')
-rw-r--r-- | ace/ACE.i | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ace/ACE.i b/ace/ACE.i index 8d00aed2d7c..d6d3398a053 100644 --- a/ace/ACE.i +++ b/ace/ACE.i @@ -65,3 +65,13 @@ ACE::get_flags (ACE_HANDLE handle) return ACE_OS::fcntl (handle, F_GETFL, 0); } +inline u_long +ACE::log2 (u_long num) +{ + for (u_long log = 0; + num > 0; + log++) + num >>= 1; + + return log; +} |