📄 abl_heap.h
字号:
/***********************************************************************
* $Workfile: abl_heap.h $
* $Revision: 1.0 $
* $Author: WellsK $
* $Date: Jun 09 2003 12:02:14 $
*
* Project: Simple heap manager
*
* Description:
* This package provides a simple heap manager with the first-fit
* algorithm. Before the package can be used, a call to
* abl_heap_init must be performed with the base heap address and
* the size of the heap in bytes.
*
* All returned allocation areas are 32-bit aligned.
*
* Revision History:
* $Log: //smaicnt2/pvcs/VM/sharpmcu/archives/sharpmcu/software/abl/include/abl_heap.h-arc $
*
* Rev 1.0 Jun 09 2003 12:02:14 WellsK
* Initial revision.
*
*
***********************************************************************
* SHARP MICROELECTRONICS OF THE AMERICAS MAKES NO REPRESENTATION
* OR WARRANTIES WITH RESPECT TO THE PERFORMANCE OF THIS SOFTWARE,
* AND SPECIFICALLY DISCLAIMS ANY RESPONSIBILITY FOR ANY DAMAGES,
* SPECIAL OR CONSEQUENTIAL, CONNECTED WITH THE USE OF THIS SOFTWARE.
*
* SHARP MICROELECTRONICS OF THE AMERICAS PROVIDES THIS SOFTWARE SOLELY
* FOR THE PURPOSE OF SOFTWARE DEVELOPMENT INCORPORATING THE USE OF A
* SHARP MICROCONTROLLER OR SYSTEM-ON-CHIP PRODUCT. USE OF THIS SOURCE
* FILE IMPLIES ACCEPTANCE OF THESE CONDITIONS.
*
* COPYRIGHT (C) 2001 SHARP MICROELECTRONICS OF THE AMERICAS, INC.
* CAMAS, WA
**********************************************************************/
#ifndef ABL_HEAP_H
#define ABL_HEAP_H
#ifdef __cplusplus
#if __cplusplus
extern "C"
{
#endif
#endif
#include "abl_types.h"
/***********************************************************************
* Heap statistics
**********************************************************************/
/* Return the size of the heap area */
UNS_32 abl_get_heapsize(void);
/* Return the size of the largest unallocated heap chunk */
UNS_32 abl_get_largest_chunk(void);
/* Return the number of allocated items in the heap */
UNS_32 abl_get_allocated_count(void);
/* Return the heap base address */
void *abl_get_heap_base(void);
/***********************************************************************
* Heap functions
**********************************************************************/
/* Setup the heap area */
void abl_heap_init(void *base_addr, UNS_32 heap_size);
/* Get an allocated area from the heap */
void *abl_new(UNS_32 size_in_bytes);
/* Return an allocated area to the heap */
INT_32 abl_free(void *free_addr);
#ifdef __cplusplus
}
#endif
#endif /* ABL_HEAP_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -