vpx_mem_intrnl.h 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef VPX_MEM_INCLUDE_VPX_MEM_INTRNL_H_
  11. #define VPX_MEM_INCLUDE_VPX_MEM_INTRNL_H_
  12. #include "./vpx_config.h"
  13. #define ADDRESS_STORAGE_SIZE sizeof(size_t)
  14. #ifndef DEFAULT_ALIGNMENT
  15. # if defined(VXWORKS)
  16. # define DEFAULT_ALIGNMENT 32 /*default addr alignment to use in
  17. calls to vpx_* functions other
  18. than vpx_memalign*/
  19. # else
  20. # define DEFAULT_ALIGNMENT (2 * sizeof(void*)) /* NOLINT */
  21. # endif
  22. #endif
  23. /*returns an addr aligned to the byte boundary specified by align*/
  24. #define align_addr(addr,align) (void*)(((size_t)(addr) + ((align) - 1)) & (size_t)-(align))
  25. #endif // VPX_MEM_INCLUDE_VPX_MEM_INTRNL_H_