Back to index

enigmail  1.4.3
Classes | Functions
mozilla Namespace Reference


class  BloomFilter
class  RangedPtr
class  RefCounted
 RefCounted<T> is a sort of a "mixin" for a class T. More...
class  RefPtr
 RefPtr points to a refcounted thing that has AddRef and Release methods to increase/decrease the refcount, respectively. More...
class  TemporaryRef
 TemporaryRef<T> represents an object that holds a temporary reference to a T. More...
class  OutParamRef
 OutParamRef is a wrapper that tracks a refcounted pointer passed as an outparam argument to a function. More...


 HashBytes (const void *bytes, size_t length)
template<typename T >
OutParamRef< T > byRef (RefPtr< T > &ptr)
 byRef cooperates with OutParamRef to implement COM outparam semantics.

Function Documentation

template<typename T >
OutParamRef< T > mozilla::byRef ( RefPtr< T > &  ptr)

byRef cooperates with OutParamRef to implement COM outparam semantics.

Definition at line 280 of file RefPtr.h.

    return OutParamRef<T>(ptr);
mozilla::HashBytes ( const void *  bytes,
size_t  length 

Definition at line 49 of file HashFunctions.cpp.

  uint32_t hash = 0;
  const char* b = reinterpret_cast<const char*>(bytes);

  /* Walk word by word. */
  size_t i = 0;
  for (; i < length - (length % sizeof(size_t)); i += sizeof(size_t)) {
    /* Do an explicitly unaligned load of the data. */
    size_t data;
    memcpy(&data, b + i, sizeof(size_t));

    hash = AddToHash(hash, data, sizeof(data));

  /* Get the remaining bytes. */
  for (; i < length; i++) {
    hash = AddToHash(hash, b[i]);

  return hash;