Changeset View
Changeset View
Standalone View
Standalone View
include/malloc_np.h
Show All 27 Lines | |||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, | ||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _MALLOC_NP_H_ | #ifndef _MALLOC_NP_H_ | ||||
#define _MALLOC_NP_H_ | #define _MALLOC_NP_H_ | ||||
#include <sys/cdefs.h> | |||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <stdbool.h> | |||||
#include <strings.h> | |||||
#ifdef __cplusplus | |||||
#define __MyBool bool | |||||
#else | |||||
#define __MyBool _Bool | |||||
#endif | |||||
__BEGIN_DECLS | __BEGIN_DECLS | ||||
typedef struct extent_hooks_s extent_hooks_t; | typedef struct extent_hooks_s extent_hooks_t; | ||||
typedef void *(extent_alloc_t)(extent_hooks_t *, void *, size_t, size_t, bool *, | typedef void *(extent_alloc_t)(extent_hooks_t *, void *, size_t, size_t, | ||||
bool *, unsigned); | __MyBool *, __MyBool *, unsigned); | ||||
typedef bool (extent_dalloc_t)(extent_hooks_t *, void *, size_t, bool, | typedef __MyBool (extent_dalloc_t)(extent_hooks_t *, void *, size_t, __MyBool, | ||||
unsigned); | unsigned); | ||||
typedef void (extent_destroy_t)(extent_hooks_t *, void *, size_t, bool, | typedef void (extent_destroy_t)(extent_hooks_t *, void *, size_t, __MyBool, | ||||
unsigned); | unsigned); | ||||
typedef bool (extent_commit_t)(extent_hooks_t *, void *, size_t, size_t, size_t, | typedef __MyBool (extent_commit_t)(extent_hooks_t *, void *, size_t, size_t, | ||||
unsigned); | |||||
typedef bool (extent_decommit_t)(extent_hooks_t *, void *, size_t, size_t, | |||||
size_t, unsigned); | size_t, unsigned); | ||||
typedef bool (extent_purge_t)(extent_hooks_t *, void *, size_t, size_t, size_t, | typedef __MyBool (extent_decommit_t)(extent_hooks_t *, void *, size_t, size_t, | ||||
size_t, unsigned); | |||||
typedef __MyBool (extent_purge_t)(extent_hooks_t *, void *, size_t, size_t, size_t, | |||||
unsigned); | unsigned); | ||||
typedef bool (extent_split_t)(extent_hooks_t *, void *, size_t, size_t, size_t, | typedef __MyBool (extent_split_t)(extent_hooks_t *, void *, size_t, size_t, size_t, | ||||
bool, unsigned); | __MyBool, unsigned); | ||||
typedef bool (extent_merge_t)(extent_hooks_t *, void *, size_t, void *, size_t, | typedef __MyBool (extent_merge_t)(extent_hooks_t *, void *, size_t, void *, size_t, | ||||
bool, unsigned); | __MyBool, unsigned); | ||||
struct extent_hooks_s { | struct extent_hooks_s { | ||||
extent_alloc_t *alloc; | extent_alloc_t *alloc; | ||||
extent_dalloc_t *dalloc; | extent_dalloc_t *dalloc; | ||||
extent_destroy_t *destroy; | extent_destroy_t *destroy; | ||||
extent_commit_t *commit; | extent_commit_t *commit; | ||||
extent_decommit_t *decommit; | extent_decommit_t *decommit; | ||||
extent_purge_t *purge_lazy; | extent_purge_t *purge_lazy; | ||||
extent_purge_t *purge_forced; | extent_purge_t *purge_forced; | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
void *__mallocx(size_t size, int flags); | void *__mallocx(size_t size, int flags); | ||||
void *__rallocx(void *ptr, size_t size, int flags); | void *__rallocx(void *ptr, size_t size, int flags); | ||||
size_t __xallocx(void *ptr, size_t size, size_t extra, int flags); | size_t __xallocx(void *ptr, size_t size, size_t extra, int flags); | ||||
size_t __sallocx(const void *ptr, int flags); | size_t __sallocx(const void *ptr, int flags); | ||||
void __dallocx(void *ptr, int flags); | void __dallocx(void *ptr, int flags); | ||||
void __sdallocx(void *ptr, size_t size, int flags); | void __sdallocx(void *ptr, size_t size, int flags); | ||||
size_t __nallocx(size_t size, int flags); | size_t __nallocx(size_t size, int flags); | ||||
__END_DECLS | __END_DECLS | ||||
#undef __MyBool | |||||
#endif /* _MALLOC_NP_H_ */ | #endif /* _MALLOC_NP_H_ */ |