Add the posix_memalign(3) function to bionic

The posix_memalign(3) function is very similar to the traditional
memalign(3) function, but with better error reporting and a guarantee
that the memory it allocates can be freed.  In bionic, memalign(3)
allocated memory can be freed, so posix_memalign(3) is just a wrapper
around memalign(3).

Change-Id: I62ee908aa5ba6b887d8446a00d8298d080a6a299
This commit is contained in:
Ken Sumrall
2011-12-14 20:50:01 -08:00
parent a5cb76bca0
commit 85aad90956
2 changed files with 30 additions and 0 deletions

View File

@@ -67,6 +67,8 @@ extern unsigned long strtoul(const char *, char **, int);
extern unsigned long long strtoull(const char *, char **, int);
extern double strtod(const char *nptr, char **endptr);
extern int posix_memalign(void **memptr, size_t alignment, size_t size);
static __inline__ float strtof(const char *nptr, char **endptr)
{
return (float)strtod(nptr, endptr);