expose the struct of BLOCKHEAP

This commit is contained in:
Vincent Wei
2021-03-28 20:54:14 +08:00
parent f970fd377e
commit 561b4c3ffc
2 changed files with 20 additions and 8 deletions

View File

@@ -581,14 +581,29 @@ enum {
* @{
*/
struct _BLOCKHEAP;
/**
* MiniGUI's private block data heap.
*
* \sa InitBlockDataHeap, DestroyBlockDataHeap
*/
typedef struct _BLOCKHEAP BLOCKHEAP;
typedef struct _BLOCKHEAP {
#ifdef _MGRM_THREADS
pthread_mutex_t lock;
#endif
/** Size of one block element in bytes. */
size_t sz_block;
/** Size of the heap in blocks. */
size_t sz_heap;
/** The number of blocks extra allocated. */
size_t nr_alloc;
/** The size of usage bitmap in bytes. */
size_t sz_usage_bmp;
/** The pointer to the pre-allocated heap. */
unsigned char* heap;
/** The pointer to the usage bitmap. */
unsigned char* usage_bmp;
} BLOCKHEAP;
/**
* \var typedef BLOCKHEAP* PBLOCKHEAP
@@ -614,9 +629,6 @@ typedef BLOCKHEAP* PBLOCKHEAP;
*
* \return TRUE on success, FALSE on error.
*
* \note This function does not return anything. You should check the \a heap
* field of the \a heap structure.
*
* \sa BLOCKHEAP
*/
MG_EXPORT BOOL InitBlockDataHeap (PBLOCKHEAP heap,

View File

@@ -52,6 +52,8 @@
#ifndef GUI_BLOCKHEAP_H
#define GUI_BLOCKHEAP_H
#ifndef _MGUI_GDI_H /* included in include/gdi.h */
struct _BLOCKHEAP {
#ifdef _MGRM_THREADS
pthread_mutex_t lock;
@@ -71,8 +73,6 @@ struct _BLOCKHEAP {
unsigned char* usage_bmp;
};
#ifndef _MGUI_GDI_H /* included in include/gdi.h */
typedef struct _BLOCKHEAP BLOCKHEAP;
typedef BLOCKHEAP* PBLOCKHEAP;