base/malloc/malloc.c File Reference


Detailed Description

Dynamic memory allocation services.

Author:
Philippe Gerum
Copyright (C) 2001,2002,2003,2004 Philippe Gerum <rpm@xenomai.org>.

RTAI is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

RTAI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with RTAI; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Dynamic memory allocation services lifted and adapted from the Xenomai nucleus.

This file implements the RTAI dynamic memory allocator based on the algorithm described in "Design of a General Purpose Memory Allocator for the 4.3BSD Unix Kernel" by Marshall K. McKusick and Michael J. Karels.

Definition in file malloc.c.#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/version.h>
#include <rtai_config.h>
#include <asm/rtai.h>
#include <linux/slab.h>
#include <rtai_malloc.h>

Include dependency graph for malloc.c:

Include dependency graph

Go to the source code of this file.

Functions

 MODULE_PARM (rtai_global_heap_size,"i")
void * alloc_extent (u_long size)
void free_extent (void *p, u_long size)
void init_extent (rtheap_t *heap, rtextent_t *extent)
int rtheap_init (rtheap_t *heap, void *heapaddr, u_long heapsize, u_long pagesize)
 Initialize a memory heap.
void rtheap_destroy (rtheap_t *heap)
 Destroys a memory heap.
caddr_t get_free_range (rtheap_t *heap, u_long bsize, int log2size, int mode)
void * rtheap_alloc (rtheap_t *heap, u_long size, int mode)
 Allocate a memory block from a memory heap.
int rtheap_free (rtheap_t *heap, void *block)
 Release a memory block to a memory heap.
int __rtai_heap_init (void)
void __rtai_heap_exit (void)
 EXPORT_SYMBOL (rtheap_init)
 EXPORT_SYMBOL (rtheap_destroy)
 EXPORT_SYMBOL (rtheap_alloc)
 EXPORT_SYMBOL (rtheap_free)
 EXPORT_SYMBOL (rtai_global_heap)

Variables

int rtai_global_heap_size = RTHEAP_GLOBALSZ
void * rtai_global_heap_adr = NULL
rtheap_t rtai_global_heap


Function Documentation

EXPORT_SYMBOL rtai_global_heap   ) 
 

EXPORT_SYMBOL rtheap_free   ) 
 

EXPORT_SYMBOL rtheap_alloc   ) 
 

EXPORT_SYMBOL rtheap_destroy   ) 
 

EXPORT_SYMBOL rtheap_init   ) 
 


Generated on Thu Nov 20 11:55:31 2008 for RTAI API by doxygen 1.3.8