?? init_mem.c
字號:
/*--------------------------------------------------------------------------
MALLOC.C is part of the CARM Compiler package from Keil Software.
Copyright (c) 1995 - 2005 Keil Software. All rights reserved.
--------------------------------------------------------------------------*/
#include "ican_STDLIB.H"
struct __mp__ { /* memory pool */
struct __mp__ *next; /* single-linked list */
unsigned int len; /* length of following block */
};
struct __mp__ *__mp__; /* Memory Pool Header */
#define HLEN (sizeof(struct __mp__))
/* Memory pool header: __mp__ points to the first available.
*
* Note that the list is maintained in address order. __mp__ points to the
* block with the lowest address. That block points to the block with the
* next higher address and so on. */
/* Initialize Block oriented memory pool */
void ican_init_mempool (
void *pool, /* address of the memory pool */
unsigned int size) { /* size of the pool in bytes */
/* Set the __mp__ to point to the beginning of the pool and set
* the pool size. */
pool = (void *) (((unsigned int)pool+3)&~3); // 25.7.2005
__mp__ = (struct __mp__ *) pool; // =========
/* Set the link of the block in the pool to NULL (since it's the only
* block) and initialize the size of its data area. */
((struct __mp__ *) pool)->next = NULL;
((struct __mp__ *) pool)->len = size - HLEN;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -