1 /* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
2 This file was then part of the GNU C Library. */
4 /* Copyright (c) 2010-2012. The SimGrid Team.
5 * All rights reserved. */
7 /* This program is free software; you can redistribute it and/or modify it
8 * under the terms of the license (GNU LGPL) which comes with this package. */
17 # include <sys/types.h> /* for size_t */
18 # include <stdio.h> /* for NULL */
21 /* Allocate SIZE bytes of memory. */
22 extern void *mmalloc(void *md, size_t size);
24 /* Re-allocate the previously allocated block in void*, making the new block
26 extern void *mrealloc(void *md, void *ptr, size_t size);
28 /* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */
29 extern void *mcalloc(void *md, size_t nmemb, size_t size);
31 /* Free a block allocated by `mmalloc', `mrealloc' or `mcalloc'. */
32 extern void mfree(void *md, void *ptr);
34 /* Allocate SIZE bytes allocated to ALIGNMENT bytes. */
35 extern void *mmemalign(void *md, size_t alignment, size_t size);
37 /* Allocate SIZE bytes on a page boundary. */
38 extern void *mvalloc(void *md, size_t size);
40 extern void *mmalloc_attach(int fd, void *baseaddr);
42 extern void mmalloc_pre_detach(void *md);
44 extern void *mmalloc_detach(void *md);
46 /* return the heap used when NULL is passed as first argument to any mm* function */
47 extern void *mmalloc_get_default_md(void);
49 extern int mmtrace(void);
51 extern void *mmalloc_findbase(int size);
53 extern int mmalloc_compare_heap(void *h1, void *h2, void *std_heap_addr);
55 extern void mmalloc_display_info_heap(void *h);
57 /* To change the heap used when using the legacy version malloc/free/realloc and such */
58 void mmalloc_set_current_heap(void *new_heap);
59 void *mmalloc_get_current_heap(void);
63 #endif /* MMALLOC_H */