Implement thunk_malloc() and think_free()

This commit is contained in:
reinoud 2011-08-24 10:56:44 +00:00
parent 14e36cd2fb
commit 5477dab842
2 changed files with 18 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: thunk.h,v 1.15 2011/08/23 21:55:21 jmcneill Exp $ */
/* $NetBSD: thunk.h,v 1.16 2011/08/24 10:56:45 reinoud Exp $ */
/*-
* Copyright (c) 2011 Jared D. McNeill <jmcneill@invisible.ca>
@ -83,9 +83,11 @@ int thunk_aio_write(struct aiocb *);
int thunk_aio_error(const struct aiocb *);
int thunk_aio_return(struct aiocb *);
void * thunk_malloc(size_t len);
void thunk_free(void *addr);
void * thunk_sbrk(intptr_t len);
void * thunk_mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset);
int thunk_munmap(void *Addr, size_t len);
int thunk_munmap(void *addr, size_t len);
int thunk_mprotect(void *addr, size_t len, int prot);
#endif /* !_ARCH_USERMODE_INCLUDE_THUNK_H */

View File

@ -1,4 +1,4 @@
/* $NetBSD: thunk.c,v 1.17 2011/08/23 21:55:21 jmcneill Exp $ */
/* $NetBSD: thunk.c,v 1.18 2011/08/24 10:56:44 reinoud Exp $ */
/*-
* Copyright (c) 2011 Jared D. McNeill <jmcneill@invisible.ca>
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: thunk.c,v 1.17 2011/08/23 21:55:21 jmcneill Exp $");
__RCSID("$NetBSD: thunk.c,v 1.18 2011/08/24 10:56:44 reinoud Exp $");
#include <sys/types.h>
#include <sys/ansi.h>
@ -288,6 +288,18 @@ thunk_aio_return(struct aiocb *aiocbp)
return aio_return(aiocbp);
}
void *
thunk_malloc(size_t len)
{
return malloc(len);
}
void
thunk_free(void *addr)
{
free(addr);
}
void *
thunk_sbrk(intptr_t len)
{