John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 1 | /* |
Yaowu Xu | 9c01aa1 | 2016-09-01 14:32:49 -0700 | [diff] [blame] | 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 3 | * |
Yaowu Xu | 9c01aa1 | 2016-09-01 14:32:49 -0700 | [diff] [blame] | 4 | * This source code is subject to the terms of the BSD 2 Clause License and |
| 5 | * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License |
| 6 | * was not distributed with this source code in the LICENSE file, you can |
| 7 | * obtain it at www.aomedia.org/license/software. If the Alliance for Open |
| 8 | * Media Patent License 1.0 was not distributed with this source code in the |
| 9 | * PATENTS file, you can obtain it at www.aomedia.org/license/patent. |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 10 | */ |
| 11 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 12 | #ifndef AOM_MEM_INCLUDE_AOM_MEM_INTRNL_H_ |
| 13 | #define AOM_MEM_INCLUDE_AOM_MEM_INTRNL_H_ |
| 14 | #include "./aom_config.h" |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 15 | |
clang-format | 031d46c | 2016-08-10 18:35:20 -0700 | [diff] [blame] | 16 | #define ADDRESS_STORAGE_SIZE sizeof(size_t) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 17 | |
| 18 | #ifndef DEFAULT_ALIGNMENT |
clang-format | 031d46c | 2016-08-10 18:35:20 -0700 | [diff] [blame] | 19 | #if defined(VXWORKS) |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 20 | /*default addr alignment to use in calls to aom_* functions other than |
Yaowu Xu | 9c01aa1 | 2016-09-01 14:32:49 -0700 | [diff] [blame] | 21 | aom_memalign*/ |
clang-format | 031d46c | 2016-08-10 18:35:20 -0700 | [diff] [blame] | 22 | #define DEFAULT_ALIGNMENT 32 |
| 23 | #else |
| 24 | #define DEFAULT_ALIGNMENT (2 * sizeof(void *)) /* NOLINT */ |
| 25 | #endif |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 26 | #endif |
| 27 | |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 28 | /*returns an addr aligned to the byte boundary specified by align*/ |
clang-format | 031d46c | 2016-08-10 18:35:20 -0700 | [diff] [blame] | 29 | #define align_addr(addr, align) \ |
James Zern | 20b8598 | 2016-08-27 10:34:40 -0700 | [diff] [blame] | 30 | (void *)(((size_t)(addr) + ((align)-1)) & ~(size_t)((align)-1)) |
John Koleszar | 0ea50ce | 2010-05-18 11:58:33 -0400 | [diff] [blame] | 31 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 32 | #endif // AOM_MEM_INCLUDE_AOM_MEM_INTRNL_H_ |