File: c99_aligned_alloc.h

package info (click to toggle)
libjodycode 4.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,676 kB
  • sloc: ansic: 2,820; makefile: 372; sh: 160; xml: 37
file content (29 lines) | stat: -rw-r--r-- 651 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* Implementation of C11 aligned_alloc() using POSIX 2001 posix_memalign()
 *
 * Created by Jody Bruchon <jody@jodybruchon.com>
 *
 * Released into the public domain, and under the Creative Commons 0 license:
 * https://creativecommons.org/public-domain/cc0/
 */

#ifndef C99_ALIGNED_ALLOC_H
#define C99_ALIGNED_ALLOC_H

#ifdef __cplusplus
extern "C" {
#endif

/* Required for uint64_t */
#include <stdlib.h>

#if !(_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600)
 #error POSIX 2001 compliant environment is required
#endif

extern void *aligned_alloc(size_t alignment, size_t size);

#ifdef __cplusplus
}
#endif

#endif	/* C99_ALIGNED_ALLOC_H */