Changeset 2135


Ignore:
Timestamp:
May 23, 2012, 3:16:20 PM (7 years ago)
Author:
ksherdy
Message:

Added alignment assertion.

Location:
trunk/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/bitblock.hpp

    r2133 r2135  
    4343static IDISA_ALWAYS_INLINE BitBlock mask_reverse_zeroes(uint32_t count);
    4444static IDISA_ALWAYS_INLINE uint32_t bitstream_scan(BitBlock * v, uint32_t pos);
     45static IDISA_ALWAYS_INLINE void assert_bitblock_align(void * addr);
    4546static IDISA_ALWAYS_INLINE void assert_bitblock_align(BitBlock v);
    4647
  • trunk/lib/bitblock_align.hpp

    r2133 r2135  
    1212using namespace std;
    1313
     14static IDISA_ALWAYS_INLINE void assert_bitblock_align(void * addr) {
     15    assert(0 == (addr) & (sizeof(BitBlock)-1));
     16}
     17
    1418static IDISA_ALWAYS_INLINE void assert_bitblock_align(BitBlock v) {
    15     assert(0 != (&v) & (sizeof(BitBlock)-1));
     19    assert(0 == (&v) & (sizeof(BitBlock)-1));
    1620}
    1721
  • trunk/lib/hash.hpp

    r2093 r2135  
    1010// #define HASH_HPP_DEBUG
    1111
    12 #define NDEBUG // if NDEBUG then disable assertions
     12//#define NDEBUG // if NDEBUG then disable assertions
    1313
    1414#include "../lib/bitblock.hpp"
Note: See TracChangeset for help on using the changeset viewer.