STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
__gnu_profile::__stack_hash Class Reference

Hash function for summary trace using call stack as index. More...

#include <profile/impl/profiler_node.h>

Public Member Functions

std::size_t operator() (__stack_t __s) const
 
bool operator() (__stack_t __stack1, __stack_t __stack2) const
 

Detailed Description

Hash function for summary trace using call stack as index.

Member Function Documentation

std::size_t __gnu_profile::__stack_hash::operator() ( __stack_t  __s) const
inline
94  {
95  if (!__s)
96  return 0;
97 
98  std::size_t __index = 0;
99  __stack_npt::const_iterator __it;
100  for (__it = __s->begin(); __it != __s->end(); ++__it)
101  __index += reinterpret_cast<std::size_t>(*__it);
102  return __index;
103  }
__SIZE_TYPE__ size_t
Definition: stddef.h:212
bool __gnu_profile::__stack_hash::operator() ( __stack_t  __stack1,
__stack_t  __stack2 
) const
inline
106  {
107  if (!__stack1 && !__stack2)
108  return true;
109  if (!__stack1 || !__stack2)
110  return false;
111  if (__stack1->size() != __stack2->size())
112  return false;
113 
114  std::size_t __byte_size
115  = __stack1->size() * sizeof(__stack_npt::value_type);
116  return __builtin_memcmp(&(*__stack1)[0], &(*__stack2)[0],
117  __byte_size) == 0;
118  }
__SIZE_TYPE__ size_t
Definition: stddef.h:212

The documentation for this class was generated from the following file: