提交 b07a5d66 编写于 作者: R Rich Felker

move __memalign declaration to malloc_impl.h

the malloc-implementation-private header is the only right place for
this, because, being in the reserved namespace, __memalign is not
interposable and thus not valid to use anywhere else. anything outside
of the malloc implementation must call an appropriate-namespace public
function (aligned_alloc or posix_memalign).
上级 762cf6cd
...@@ -12,6 +12,8 @@ void *__expand_heap(size_t *); ...@@ -12,6 +12,8 @@ void *__expand_heap(size_t *);
void __malloc_donate(char *, char *); void __malloc_donate(char *, char *);
void *__memalign(size_t, size_t);
struct chunk { struct chunk {
size_t psize, csize; size_t psize, csize;
struct chunk *next, *prev; struct chunk *next, *prev;
......
#include <stdlib.h> #include <stdlib.h>
#include "malloc_impl.h"
void *__memalign(size_t, size_t);
void *aligned_alloc(size_t align, size_t len) void *aligned_alloc(size_t align, size_t len)
{ {
......
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
#include "malloc_impl.h"
void *__memalign(size_t, size_t);
int posix_memalign(void **res, size_t align, size_t len) int posix_memalign(void **res, size_t align, size_t len)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册