This commit is contained in:
parent
3bba87c227
commit
5b69c0a1e9
|
@ -168,6 +168,7 @@ unsigned long strtoul(const char *restrict, char **restrict, int);
|
|||
//----------------------------------------------------------------------------//
|
||||
|
||||
void *calloc(size_t, size_t) __attribute__((__malloc__));
|
||||
void *memalign(size_t n, size_t align) __attribute__((__malloc__));
|
||||
void *malloc(size_t) __attribute__((__malloc__));
|
||||
void free(void *);
|
||||
|
||||
|
|
|
@ -46,6 +46,21 @@ void *malloc(size_t n)
|
|||
return ptr;
|
||||
}
|
||||
|
||||
void *memalign(size_t n, size_t align)
|
||||
{
|
||||
void *ptr;
|
||||
error_t rc;
|
||||
|
||||
#ifndef _KALEID_KERNEL
|
||||
rc = KalAllocMemoryEx(&ptr, n, 0, align);
|
||||
#else
|
||||
rc = KalAllocMemoryEx(&ptr, n, M_ZEROED, align);
|
||||
#endif
|
||||
if (rc > 0) seterrno(rc);
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void *calloc(size_t n, size_t m)
|
||||
{
|
||||
void *ptr;
|
||||
|
|
Loading…
Reference in New Issue