OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [newlib/] [libc/] [include/] [malloc.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1005 ivang
/* malloc.h -- header file for memory routines.  */
2
 
3
#ifndef _INCLUDE_MALLOC_H_
4
#define _INCLUDE_MALLOC_H_
5
 
6
#include <_ansi.h>
7
#include <sys/reent.h>
8
 
9
#define __need_size_t
10
#include <stddef.h>
11
 
12
#ifdef __cplusplus
13
extern "C" {
14
#endif
15
 
16
/* This version of struct mallinfo must match the one in
17
   libc/stdlib/mallocr.c.  */
18
 
19
struct mallinfo {
20
  int arena;    /* total space allocated from system */
21
  int ordblks;  /* number of non-inuse chunks */
22
  int smblks;   /* unused -- always zero */
23
  int hblks;    /* number of mmapped regions */
24
  int hblkhd;   /* total space in mmapped regions */
25
  int usmblks;  /* unused -- always zero */
26
  int fsmblks;  /* unused -- always zero */
27
  int uordblks; /* total allocated space */
28
  int fordblks; /* total non-inuse space */
29
  int keepcost; /* top-most, releasable (via malloc_trim) space */
30
};
31
 
32
/* The routines.  */
33
 
34
extern _PTR malloc _PARAMS ((size_t));
35
extern _PTR _malloc_r _PARAMS ((struct _reent *, size_t));
36
 
37
extern _VOID free _PARAMS ((_PTR));
38
extern _VOID _free_r _PARAMS ((struct _reent *, _PTR));
39
 
40
extern _PTR realloc _PARAMS ((_PTR, size_t));
41
extern _PTR _realloc_r _PARAMS ((struct _reent *, _PTR, size_t));
42
 
43
extern _PTR calloc _PARAMS ((size_t, size_t));
44
extern _PTR _calloc_r _PARAMS ((struct _reent *, size_t, size_t));
45
 
46
extern _PTR memalign _PARAMS ((size_t, size_t));
47
extern _PTR _memalign_r _PARAMS ((struct _reent *, size_t, size_t));
48
 
49
extern struct mallinfo mallinfo _PARAMS ((void));
50
extern struct mallinfo _mallinfo_r _PARAMS ((struct _reent *));
51
 
52
extern void malloc_stats _PARAMS ((void));
53
extern void _malloc_stats_r _PARAMS ((struct _reent *));
54
 
55
extern int mallopt _PARAMS ((int, int));
56
extern int _mallopt_r _PARAMS ((struct _reent *, int, int));
57
 
58
extern size_t malloc_usable_size _PARAMS ((_PTR));
59
extern size_t _malloc_usable_size_r _PARAMS ((struct _reent *, _PTR));
60
 
61
/* These aren't too useful on an embedded system, but we define them
62
   anyhow.  */
63
 
64
extern _PTR valloc _PARAMS ((size_t));
65
extern _PTR _valloc_r _PARAMS ((struct _reent *, size_t));
66
 
67
extern _PTR pvalloc _PARAMS ((size_t));
68
extern _PTR _pvalloc_r _PARAMS ((struct _reent *, size_t));
69
 
70
extern int malloc_trim _PARAMS ((size_t));
71
extern int _malloc_trim_r _PARAMS ((struct _reent *, size_t));
72
 
73
/* A compatibility routine for an earlier version of the allocator.  */
74
 
75
extern _VOID mstats _PARAMS ((char *));
76
extern _VOID _mstats_r _PARAMS ((struct _reent *, char *));
77
 
78
/* SVID2/XPG mallopt options */
79
 
80
#define M_MXFAST  1    /* UNUSED in this malloc */
81
#define M_NLBLKS  2    /* UNUSED in this malloc */
82
#define M_GRAIN   3    /* UNUSED in this malloc */
83
#define M_KEEP    4    /* UNUSED in this malloc */
84
 
85
/* mallopt options that actually do something */
86
 
87
#define M_TRIM_THRESHOLD    -1
88
#define M_TOP_PAD           -2
89
#define M_MMAP_THRESHOLD    -3 
90
#define M_MMAP_MAX          -4
91
 
92
#ifndef __CYGWIN__
93
/* Some systems provide this, so do too for compatibility.  */
94
extern void cfree _PARAMS ((_PTR));
95
#endif /* __CYGWIN__ */
96
 
97
#ifdef __cplusplus
98
}
99
#endif
100
 
101
#endif /* _INCLUDE_MALLOC_H_ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.