Changeset 2157


Ignore:
Timestamp:
May 24, 2012, 7:45:05 PM (7 years ago)
Author:
ksherdy
Message:

Added size parameter to macros.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/buffer.hpp

    r2156 r2157  
    4040    base_ptr = &aligned_##base_ptr[0];\
    4141
    42 #define ALLOC_STATIC_ALIGNED_BYTE_BUFFER_WITH_COPYBACK(copyback_ptr, base_ptr, buffer_size) \
     42#define ALLOC_STATIC_ALIGNED_BYTE_BUFFER_WITH_COPYBACK(copyback_ptr, base_ptr, copyback_size, buffer_size) \
    4343    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]; \
     46    memset(copyback_ptr,0,copyback_size); \
     47    base_ptr = (uint8_t *)&copyback_ptr[copyback_size/BLOCK_SIZE]; \
    4848
    49 #define ALLOC_STATIC_ALIGNED_BITBLOCK_BUFFER_WITH_COPYBACK(copyback_ptr, base_ptr, buffer_size) \
     49#define ALLOC_STATIC_ALIGNED_BITBLOCK_BUFFER_WITH_COPYBACK(copyback_ptr, base_ptr, copyback_size, buffer_size) \
    5050    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_BLOCKS]; \
     53    memset(copyback_ptr,0,copyback_size/8); \
     54    base_ptr = &copyback_ptr[copyback_size/BLOCK_SIZE]; \
    5555
    5656#define COPY_BACK_BYTE_BUFFER(copyback_ptr, base_ptr, copyback_size, segment_size) \
Note: See TracChangeset for help on using the changeset viewer.