summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/malloc.c
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2004-03-23 06:07:53 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2004-03-23 06:07:53 +0000
commit83c5fc1bb9b45c22e428e1f7642b5a67cbf44b98 (patch)
tree76b5d9d4ee1884f779f727c1d33098a34ba0f7bf /cpukit/libcsupport/src/malloc.c
parent2004-03-22 Ralf Corsepius <ralf_corsepius@rtems.org> (diff)
downloadrtems-83c5fc1bb9b45c22e428e1f7642b5a67cbf44b98.tar.bz2
2004-03-23 Ralf Corsepius <ralf_corsepius@rtems.org>
* libcsupport/include/chain.h, libcsupport/include/clockdrv.h, libcsupport/include/ringbuf.h, libcsupport/include/spurious.h, libcsupport/include/timerdrv.h, libcsupport/include/vmeintr.h, libcsupport/include/motorola/mc68230.h, libcsupport/include/rtems/assoc.h, libcsupport/include/rtems/libio.h, libcsupport/include/rtems/libio_.h, libcsupport/include/rtems/termiostypes.h, libcsupport/include/zilog/z8036.h, libcsupport/include/zilog/z8530.h, libcsupport/include/zilog/z8536.h, libcsupport/src/__gettod.c, libcsupport/src/assoc.c, libcsupport/src/assocnamebad.c, libcsupport/src/error.c, libcsupport/src/libio.c, libcsupport/src/libio_sockets.c, libcsupport/src/malloc.c, libcsupport/src/no_libc.c, libcsupport/src/termios.c, libcsupport/src/termiosreserveresources.c: Convert to using c99 fixed-size types.
Diffstat (limited to 'cpukit/libcsupport/src/malloc.c')
-rw-r--r--cpukit/libcsupport/src/malloc.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/cpukit/libcsupport/src/malloc.c b/cpukit/libcsupport/src/malloc.c
index ebee514393..56b2f8cfc5 100644
--- a/cpukit/libcsupport/src/malloc.c
+++ b/cpukit/libcsupport/src/malloc.c
@@ -49,14 +49,14 @@ size_t RTEMS_Malloc_Sbrk_amount;
#define MSBUMP(f,n) rtems_malloc_stats.f += (n)
struct {
- unsigned32 space_available; /* current size of malloc area */
- unsigned32 malloc_calls; /* # calls to malloc */
- unsigned32 free_calls;
- unsigned32 realloc_calls;
- unsigned32 calloc_calls;
- unsigned32 max_depth; /* most ever malloc'd at 1 time */
- unsigned64 lifetime_allocated;
- unsigned64 lifetime_freed;
+ uint32_t space_available; /* current size of malloc area */
+ uint32_t malloc_calls; /* # calls to malloc */
+ uint32_t free_calls;
+ uint32_t realloc_calls;
+ uint32_t calloc_calls;
+ uint32_t max_depth; /* most ever malloc'd at 1 time */
+ uint64_t lifetime_allocated;
+ uint64_t lifetime_freed;
} rtems_malloc_stats;
#else /* No rtems_malloc_stats */
@@ -71,8 +71,8 @@ void RTEMS_Malloc_Initialize(
{
rtems_status_code status;
void *starting_address;
- rtems_unsigned32 old_address;
- rtems_unsigned32 u32_address;
+ uint32_t old_address;
+ uint32_t u32_address;
/*
* Initialize the garbage collection list to start with nothing on it.
@@ -91,7 +91,7 @@ void RTEMS_Malloc_Initialize(
if (!starting_address) {
u32_address = (unsigned int)sbrk(length);
- if (u32_address == (rtems_unsigned32) -1) {
+ if (u32_address == (uint32_t ) -1) {
rtems_fatal_error_occurred( RTEMS_NO_MEMORY );
/* DOES NOT RETURN!!! */
}
@@ -156,8 +156,8 @@ void *malloc(
{
void *return_this;
void *starting_address;
- rtems_unsigned32 the_size;
- rtems_unsigned32 sbrk_amount;
+ uint32_t the_size;
+ uint32_t sbrk_amount;
rtems_status_code status;
Chain_Node *to_be_freed;
@@ -212,8 +212,8 @@ void *malloc(
the_size = ((size + sbrk_amount) / sbrk_amount * sbrk_amount);
- if (((rtems_unsigned32)starting_address = (void *)sbrk(the_size))
- == (rtems_unsigned32) -1)
+ if (((uint32_t )starting_address = (void *)sbrk(the_size))
+ == (uint32_t ) -1)
return (void *) 0;
status = rtems_region_extend(
@@ -245,8 +245,8 @@ void *malloc(
#ifdef MALLOC_STATS
if (return_this)
{
- unsigned32 actual_size;
- unsigned32 current_depth;
+ uint32_t actual_size;
+ uint32_t current_depth;
status = rtems_region_get_segment_size(
RTEMS_Malloc_Heap, return_this, &actual_size);
MSBUMP(lifetime_allocated, actual_size);
@@ -289,7 +289,7 @@ void *realloc(
size_t size
)
{
- rtems_unsigned32 old_size;
+ uint32_t old_size;
rtems_status_code status;
char *new_area;
@@ -369,7 +369,7 @@ void free(
#ifdef MALLOC_STATS
{
- unsigned32 size;
+ uint32_t size;
status = rtems_region_get_segment_size( RTEMS_Malloc_Heap, ptr, &size );
if ( status == RTEMS_SUCCESSFUL ) {
MSBUMP(lifetime_freed, size);
@@ -395,7 +395,7 @@ void free(
void malloc_dump(void)
{
- unsigned32 allocated = rtems_malloc_stats.lifetime_allocated -
+ uint32_t allocated = rtems_malloc_stats.lifetime_allocated -
rtems_malloc_stats.lifetime_freed;
printf("Malloc stats\n");
@@ -407,8 +407,8 @@ void malloc_dump(void)
(allocated * 100) / rtems_malloc_stats.space_available,
(unsigned int) rtems_malloc_stats.max_depth / 1024,
(rtems_malloc_stats.max_depth * 100) / rtems_malloc_stats.space_available,
- (unsigned64) rtems_malloc_stats.lifetime_allocated / 1024,
- (unsigned64) rtems_malloc_stats.lifetime_freed / 1024);
+ (uint64_t ) rtems_malloc_stats.lifetime_allocated / 1024,
+ (uint64_t ) rtems_malloc_stats.lifetime_freed / 1024);
printf(" Call counts: malloc:%d free:%d realloc:%d calloc:%d\n",
rtems_malloc_stats.malloc_calls,
rtems_malloc_stats.free_calls,