1 /* 2 * Copyright (c) 2013 The WebRTC 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 11 #ifndef WEBRTC_ARM_FFT_TEST_ALIGNED_PTR_H_ 12 #define WEBRTC_ARM_FFT_TEST_ALIGNED_PTR_H_ 13 14 /* 15 * Simple aligned pointer structure to get provide aligned pointers 16 * that can be freed. 17 */ 18 struct AlignedPtr { 19 void* raw_pointer_; 20 void* aligned_pointer_; 21 }; 22 23 /* 24 * Allocate an aligned pointer to an area of size |bytes| bytes. The 25 * pointer is aligned to |alignment| bytes, which MUST be a power of 26 * two. The aligned pointer itself is in the aligned_pointer_ slot of 27 * the structure. 28 */ 29 struct AlignedPtr* AllocAlignedPointer(int alignment, int bytes); 30 31 /* 32 * Free the memory allocated for the aligned pointer, including the 33 * object itself. 34 */ 35 void FreeAlignedPointer(struct AlignedPtr* pointer); 36 37 #endif 38