This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Allocate aligned memory in a portable way. | |
* | |
* Memory allocated with aligned alloc *MUST* be freed using aligned_free. | |
* | |
* @param alignment The number of bytes to which memory must be aligned. This | |
* value *must* be <= 255. | |
* @param bytes The number of bytes to allocate. | |
* @param zero If true, the returned memory will be zeroed. If false, the | |
* contents of the returned memory are undefined. | |
* @returns A pointer to `size` bytes of memory, aligned to an `alignment`-byte |