vpx_mem_intrnl.h 1.0 KB

12345678910111213141516171819202122232425262728293031
  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. /*default addr alignment to use in calls to vpx_* functions other than
  17. * vpx_memalign*/
  18. #define DEFAULT_ALIGNMENT 32
  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) \
  25. (void *)(((size_t)(addr) + ((align)-1)) & ~(size_t)((align)-1))
  26. #endif // VPX_MEM_INCLUDE_VPX_MEM_INTRNL_H_