Changeset 2159


Ignore:
Timestamp:
May 24, 2012, 8:02:28 PM (7 years ago)
Author:
ksherdy
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/buffer.hpp

    r2157 r2159  
    4040    base_ptr = &aligned_##base_ptr[0];\
    4141
    42 #define ALLOC_STATIC_ALIGNED_BYTE_BUFFER_WITH_COPYBACK(copyback_ptr, base_ptr, copyback_size, buffer_size) \
    43     ATTRIBUTE_SIMD_ALIGN BitBlock aligned_##base_ptr[buffer_size/sizeof(BitBlock)]; \
     42#define ALLOC_STATIC_ALIGNED_BYTE_BUFFER_WITH_COPYBACK(copyback_ptr, base_ptr) \
     43    ATTRIBUTE_SIMD_ALIGN BitBlock aligned_##base_ptr[BUFFER_SIZE/sizeof(BitBlock)]; \
    4444    assert_bitblock_align((void*)aligned_##base_ptr);\
    4545    copyback_ptr = (uint8_t *)aligned_##base_ptr; \
    46     memset(copyback_ptr,0,copyback_size); \
    47     base_ptr = (uint8_t *)&copyback_ptr[copyback_size/BLOCK_SIZE]; \
     46    memset(copyback_ptr,0,COPYBACK_SIZE); \
     47    base_ptr = &copyback_ptr[COPYBACK_SIZE]; \
    4848
    49 #define ALLOC_STATIC_ALIGNED_BITBLOCK_BUFFER_WITH_COPYBACK(copyback_ptr, base_ptr, copyback_size, buffer_size) \
    50     ATTRIBUTE_SIMD_ALIGN BitBlock aligned_##base_ptr[buffer_size/sizeof(BitBlock)/8]; \
     49#define ALLOC_STATIC_ALIGNED_BITBLOCK_BUFFER_WITH_COPYBACK(copyback_ptr, base_ptr) \
     50    ATTRIBUTE_SIMD_ALIGN BitBlock aligned_##base_ptr[BUFFER_SIZE/sizeof(BitBlock)/8]; \
    5151    assert_bitblock_align((void*)aligned_##base_ptr);\
    5252    copyback_ptr = (BitBlock *) aligned_##base_ptr; \
    53     memset(copyback_ptr,0,copyback_size/8); \
    54     base_ptr = &copyback_ptr[copyback_size/BLOCK_SIZE]; \
     53    memset(copyback_ptr,0,COPYBACK_SIZE/8); \
     54    base_ptr = &copyback_ptr[COPYBACK_BLOCKS]; \
    5555
    56 #define COPY_BACK_BYTE_BUFFER(copyback_ptr, base_ptr, copyback_size, segment_size) \
     56#define COPY_BACK_BYTE_BUFFER(copyback_ptr, base_ptr) \
    5757do {    void * dest = copyback_ptr;\
    58     void * src = (uint8_t *)base_ptr + (segment_size - copyback_size);\
    59         assert_bitblock_align(src);\
    60         assert_bitblock_align(dest);\
    61     memmove(dest, src, copyback_size);\
     58    void * src = (uint8_t *)base_ptr + (SEGMENT_SIZE - COPYBACK_SIZE);\
     59    assert_bitblock_align(src);\
     60    assert_bitblock_align(dest);\
     61    memmove(dest, src, COPYBACK_SIZE);\
    6262} while(0)
    6363
    64 #define COPY_BACK_BITBLOCK_BUFFER(copyback_ptr, base_ptr, copyback_size, segment_size) \
     64#define COPY_BACK_BITBLOCK_BUFFER(copyback_ptr, base_ptr) \
    6565do {    void * dest = copyback_ptr;\
    66     void * src = (uint8_t *)base_ptr + ((segment_size - copyback_size)/8);\
    67         assert_bitblock_align(src);\
    68         assert_bitblock_align(dest);\
    69     memmove(dest, src, copyback_size/8);\
     66    void * src = (uint8_t *)base_ptr + ((SEGMENT_SIZE - COPYBACK_SIZE)/8);\
     67    assert_bitblock_align(src);\
     68    assert_bitblock_align(dest);\
     69    memmove(dest, src, COPYBACK_SIZE/8);\
    7070} while(0)
    7171
Note: See TracChangeset for help on using the changeset viewer.