22 #ifndef PLATFORM_ATARI_DLMALLOC_H 23 #define PLATFORM_ATARI_DLMALLOC_H 26 #define HAVE_MORECORE 1 27 #define MORECORE_CONTIGUOUS 0 28 #define MORECORE_CANNOT_TRIM 1 29 #define NO_MALLOC_STATS 1 32 #define MALLOC_ALIGNMENT ((size_t)16U) 34 #pragma GCC diagnostic push 36 #pragma GCC diagnostic ignored "-Wshadow" 38 #pragma GCC diagnostic ignored "-Wexpansion-to-defined" 575 #ifndef DLMALLOC_VERSION 576 #define DLMALLOC_VERSION 20806 579 #ifndef DLMALLOC_EXPORT 580 #define DLMALLOC_EXPORT extern 588 #define LACKS_FCNTL_H 593 #define WIN32_LEAN_AND_MEAN 597 #define HAVE_MORECORE 0 598 #define LACKS_UNISTD_H 599 #define LACKS_SYS_PARAM_H 600 #define LACKS_SYS_MMAN_H 601 #define LACKS_STRING_H 602 #define LACKS_STRINGS_H 603 #define LACKS_SYS_TYPES_H 604 #define LACKS_ERRNO_H 605 #define LACKS_SCHED_H 606 #ifndef MALLOC_FAILURE_ACTION 607 #define MALLOC_FAILURE_ACTION 611 #define MMAP_CLEARS 0 613 #define MMAP_CLEARS 1 618 #if defined(DARWIN) || defined(_DARWIN) 620 #ifndef HAVE_MORECORE 621 #define HAVE_MORECORE 0 624 #ifndef MALLOC_ALIGNMENT 625 #define MALLOC_ALIGNMENT ((size_t)16U) 630 #ifndef LACKS_SYS_TYPES_H 631 #include <sys/types.h> 635 #define MAX_SIZE_T (~(size_t)0) 638 #define USE_LOCKS ((defined(USE_SPIN_LOCKS) && USE_SPIN_LOCKS != 0) || \ 639 (defined(USE_RECURSIVE_LOCKS) && USE_RECURSIVE_LOCKS != 0)) 643 #if ((defined(__GNUC__) && \ 644 ((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) || \ 645 defined(__i386__) || defined(__x86_64__))) || \ 646 (defined(_MSC_VER) && _MSC_VER>=1310)) 647 #ifndef USE_SPIN_LOCKS 648 #define USE_SPIN_LOCKS 1 651 #error "USE_SPIN_LOCKS defined without implementation" 653 #elif !defined(USE_SPIN_LOCKS) 654 #define USE_SPIN_LOCKS 0 658 #define ONLY_MSPACES 0 667 #ifndef MALLOC_ALIGNMENT 668 #define MALLOC_ALIGNMENT ((size_t)(2 * sizeof(void *))) 674 #define ABORT abort() 676 #ifndef ABORT_ON_ASSERT_FAILURE 677 #define ABORT_ON_ASSERT_FAILURE 1 679 #ifndef PROCEED_ON_ERROR 680 #define PROCEED_ON_ERROR 0 686 #ifndef MALLOC_INSPECT_ALL 687 #define MALLOC_INSPECT_ALL 0 693 #define MMAP_CLEARS 1 697 #define HAVE_MREMAP 1 700 #define HAVE_MREMAP 0 703 #ifndef MALLOC_FAILURE_ACTION 704 #define MALLOC_FAILURE_ACTION errno = ENOMEM; 706 #ifndef HAVE_MORECORE 708 #define HAVE_MORECORE 0 710 #define HAVE_MORECORE 1 714 #define MORECORE_CONTIGUOUS 0 716 #define MORECORE_DEFAULT sbrk 717 #ifndef MORECORE_CONTIGUOUS 718 #define MORECORE_CONTIGUOUS 1 721 #ifndef DEFAULT_GRANULARITY 722 #if (MORECORE_CONTIGUOUS || defined(WIN32)) 723 #define DEFAULT_GRANULARITY (0) 725 #define DEFAULT_GRANULARITY ((size_t)64U * (size_t)1024U) 728 #ifndef DEFAULT_TRIM_THRESHOLD 729 #ifndef MORECORE_CANNOT_TRIM 730 #define DEFAULT_TRIM_THRESHOLD ((size_t)2U * (size_t)1024U * (size_t)1024U) 732 #define DEFAULT_TRIM_THRESHOLD MAX_SIZE_T 735 #ifndef DEFAULT_MMAP_THRESHOLD 737 #define DEFAULT_MMAP_THRESHOLD ((size_t)256U * (size_t)1024U) 739 #define DEFAULT_MMAP_THRESHOLD MAX_SIZE_T 742 #ifndef MAX_RELEASE_CHECK_RATE 744 #define MAX_RELEASE_CHECK_RATE 4095 746 #define MAX_RELEASE_CHECK_RATE MAX_SIZE_T 749 #ifndef USE_BUILTIN_FFS 750 #define USE_BUILTIN_FFS 0 752 #ifndef USE_DEV_RANDOM 753 #define USE_DEV_RANDOM 0 756 #define NO_MALLINFO 0 758 #ifndef MALLINFO_FIELD_TYPE 759 #define MALLINFO_FIELD_TYPE size_t 761 #ifndef NO_MALLOC_STATS 762 #define NO_MALLOC_STATS 0 764 #ifndef NO_SEGMENT_TRAVERSAL 765 #define NO_SEGMENT_TRAVERSAL 0 775 #define M_TRIM_THRESHOLD (-1) 776 #define M_GRANULARITY (-2) 777 #define M_MMAP_THRESHOLD (-3) 806 #ifdef HAVE_USR_INCLUDE_MALLOC_H 807 #include "/usr/include/malloc.h" 809 #ifndef STRUCT_MALLINFO_DECLARED 811 #define _STRUCT_MALLINFO 812 #define STRUCT_MALLINFO_DECLARED 1 814 MALLINFO_FIELD_TYPE arena;
815 MALLINFO_FIELD_TYPE ordblks;
816 MALLINFO_FIELD_TYPE smblks;
817 MALLINFO_FIELD_TYPE hblks;
818 MALLINFO_FIELD_TYPE hblkhd;
819 MALLINFO_FIELD_TYPE usmblks;
820 MALLINFO_FIELD_TYPE fsmblks;
821 MALLINFO_FIELD_TYPE uordblks;
822 MALLINFO_FIELD_TYPE fordblks;
823 MALLINFO_FIELD_TYPE keepcost;
835 #if defined(__GNUC__) 836 #define FORCEINLINE __inline __attribute__ ((always_inline)) 837 #elif defined(_MSC_VER) 838 #define FORCEINLINE __forceinline 842 #if defined(__GNUC__) 843 #define NOINLINE __attribute__ ((noinline)) 844 #elif defined(_MSC_VER) 845 #define NOINLINE __declspec(noinline) 854 #define FORCEINLINE inline 865 #ifndef USE_DL_PREFIX 866 #define dlcalloc calloc 868 #define dlmalloc malloc 869 #define dlmemalign memalign 870 #define dlposix_memalign posix_memalign 871 #define dlrealloc realloc 872 #define dlrealloc_in_place realloc_in_place 873 #define dlvalloc valloc 874 #define dlpvalloc pvalloc 875 #define dlmallinfo mallinfo 876 #define dlmallopt mallopt 877 #define dlmalloc_trim malloc_trim 878 #define dlmalloc_stats malloc_stats 879 #define dlmalloc_usable_size malloc_usable_size 880 #define dlmalloc_footprint malloc_footprint 881 #define dlmalloc_max_footprint malloc_max_footprint 882 #define dlmalloc_footprint_limit malloc_footprint_limit 883 #define dlmalloc_set_footprint_limit malloc_set_footprint_limit 884 #define dlmalloc_inspect_all malloc_inspect_all 885 #define dlindependent_calloc independent_calloc 886 #define dlindependent_comalloc independent_comalloc 887 #define dlbulk_free bulk_free 904 DLMALLOC_EXPORT
void* dlmalloc(
size_t);
913 DLMALLOC_EXPORT
void dlfree(
void*);
920 DLMALLOC_EXPORT
void* dlcalloc(
size_t,
size_t);
944 DLMALLOC_EXPORT
void* dlrealloc(
void*,
size_t);
959 DLMALLOC_EXPORT
void* dlrealloc_in_place(
void*,
size_t);
973 DLMALLOC_EXPORT
void* dlmemalign(
size_t,
size_t);
983 DLMALLOC_EXPORT
int dlposix_memalign(
void**,
size_t,
size_t);
990 DLMALLOC_EXPORT
void* dlvalloc(
size_t);
1014 DLMALLOC_EXPORT
int dlmallopt(
int,
int);
1025 DLMALLOC_EXPORT
size_t dlmalloc_footprint(
void);
1038 DLMALLOC_EXPORT
size_t dlmalloc_max_footprint(
void);
1049 DLMALLOC_EXPORT
size_t dlmalloc_footprint_limit(
void);
1063 DLMALLOC_EXPORT
size_t dlmalloc_set_footprint_limit(
size_t bytes);
1065 #if MALLOC_INSPECT_ALL 1094 DLMALLOC_EXPORT
void dlmalloc_inspect_all(
void(*handler)(
void*,
void *,
size_t,
void*),
1122 DLMALLOC_EXPORT
struct mallinfo dlmallinfo(void);
1174 DLMALLOC_EXPORT
void** dlindependent_calloc(
size_t,
size_t,
void**);
1232 DLMALLOC_EXPORT
void** dlindependent_comalloc(
size_t,
size_t*,
void**);
1243 DLMALLOC_EXPORT
size_t dlbulk_free(
void**,
size_t n_elements);
1250 DLMALLOC_EXPORT
void* dlpvalloc(
size_t);
1273 DLMALLOC_EXPORT
int dlmalloc_trim(
size_t);
1294 DLMALLOC_EXPORT
void dlmalloc_stats(
void);
1310 size_t dlmalloc_usable_size(
void*);
1320 typedef void* mspace;
1333 DLMALLOC_EXPORT mspace create_mspace(
size_t capacity,
int locked);
1341 DLMALLOC_EXPORT
size_t destroy_mspace(mspace msp);
1352 DLMALLOC_EXPORT mspace create_mspace_with_base(
void* base,
size_t capacity,
int locked);
1365 DLMALLOC_EXPORT
int mspace_track_large_chunks(mspace msp,
int enable);
1372 DLMALLOC_EXPORT
void* mspace_malloc(mspace msp,
size_t bytes);
1382 DLMALLOC_EXPORT
void mspace_free(mspace msp,
void* mem);
1393 DLMALLOC_EXPORT
void* mspace_realloc(mspace msp,
void* mem,
size_t newsize);
1399 DLMALLOC_EXPORT
void* mspace_calloc(mspace msp,
size_t n_elements,
size_t elem_size);
1405 DLMALLOC_EXPORT
void* mspace_memalign(mspace msp,
size_t alignment,
size_t bytes);
1411 DLMALLOC_EXPORT
void** mspace_independent_calloc(mspace msp,
size_t n_elements,
1412 size_t elem_size,
void* chunks[]);
1418 DLMALLOC_EXPORT
void** mspace_independent_comalloc(mspace msp,
size_t n_elements,
1419 size_t sizes[],
void* chunks[]);
1425 DLMALLOC_EXPORT
size_t mspace_footprint(mspace msp);
1431 DLMALLOC_EXPORT
size_t mspace_max_footprint(mspace msp);
1439 DLMALLOC_EXPORT
struct mallinfo mspace_mallinfo(mspace msp);
1445 DLMALLOC_EXPORT
size_t mspace_usable_size(
const void* mem);
1451 DLMALLOC_EXPORT
void mspace_malloc_stats(mspace msp);
1457 DLMALLOC_EXPORT
int mspace_trim(mspace msp,
size_t pad);
1462 DLMALLOC_EXPORT
int mspace_mallopt(
int,
int);
1470 #pragma GCC diagnostic pop Definition: dlmalloc.h:813