malloc.h File Reference

Header file for malloc.c. More...

#include "sys.h"

Go to the source code of this file.

Defines

#define NULL   0
#define MAX_BLOCK_SIZE   0x70000000

Typedefs

typedef int tsize

Functions

void init_memory ()
 Initialize the memory block structures.
void * alloc_mem_block (unsigned size)
 Allocate a new free memory block.
void free_mem_block (void *px)
 Mark the block as free.
void * malloc (tsize size)
 Thread safe memory allocation.
void free (void *p)
 Thread safe memory release.
void memory_leak_error ()
 Call panic when memory leak error.

Variables

unsigned int _kernel_end


Detailed Description

Header file for malloc.c.


Define Documentation

#define MAX_BLOCK_SIZE   0x70000000

Maximum size of memory block

#define NULL   0

NULL definition


Typedef Documentation

typedef int tsize

Typedef of int variables type


Function Documentation

void* alloc_mem_block ( unsigned  size  ) 

Allocate a new free memory block.

Parameters:
size - new memory block size
Returns:
pointer to new block or 0 if not enought memory
!!! This routine is NOT thread safe.

void free ( void *  ptr  ) 

Thread safe memory release.

Parameters:
ptr - pointer to memory block
This function only improve free_mem_block() to be thread save

void free_mem_block ( void *  px  ) 

Mark the block as free.

Parameters:
px - pointer to memory block
!!! This routine is NOT thread safe.

void* malloc ( tsize  size  ) 

Thread safe memory allocation.

Parameters:
size - new memory block size
This function only improve alloc_mem_block() to be thread save


Variable Documentation

unsigned int _kernel_end

A symbol containing the last address of the kernel image. The symbol will be provided by the linker.


Generated on Wed Nov 15 17:25:44 2006 for Kalisto by  doxygen 1.4.7