亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? memlib.c

?? 操作系統開發,vxwork操作系統源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
	    		    partId, pBlock, 2* (pHdr->nWords), nBytes);#endif	    partId->curWordsAllocated += pNextHdr->nWords;	/* fix stats */	    partId->cumWordsAllocated += pNextHdr->nWords;	    NEXT_HDR (pHdr)->pPrevHdr = pHdr;			/* fix next */	    /* if this combined block is too big, it will get fixed below */	    }	}    /* split off any extra and give it back;     * note that this covers both the case of a realloc for smaller space     * and the case of a realloc for bigger space that caused a coalesce     * with the next block that resulted in larger than required block */    pNextHdr = memBlockSplit (pHdr, pHdr->nWords - nWords,			      partId->minBlockWords);    semGive (&partId->sem);    if (pNextHdr != NULL)	{	(void) memPartFree (partId, HDR_TO_BLOCK (pNextHdr));	partId->curBlocksAllocated++;	/* memPartFree() is going to subtract one from the curBlocksAllocated	 * statistic. Since memPartRealloc() should not change the value of	 * curBlocksAllocated, it has to be corrected  (SPR 1407 & 3564)	 */	}    return ((void *) pBlock);    }/********************************************************************************* memPartFindMax - find the size of the largest available free block** This routine searches for the largest block in the memory partition free* list and returns its size.** RETURNS: The size, in bytes, of the largest available block.** ERRNO: S_smObjLib_NOT_INITIALIZED** SEE ALSO: smMemLib*/int memPartFindMax     (    FAST PART_ID partId         /* partition ID */    )    {    FAST BLOCK_HDR *	pHdr;    FAST DL_NODE *	pNode;    FAST unsigned	biggestWords = 0;    if (ID_IS_SHARED (partId))  /* partition is shared? */	{	if (smMemPartFindMaxRtn == NULL)	    {	    errno = S_smObjLib_NOT_INITIALIZED;	    return (ERROR);	    }        return ((*smMemPartFindMaxRtn) (SM_OBJ_ID_TO_ADRS (partId)));	}    /* partition is local */    if (OBJ_VERIFY (partId, memPartClassId) != OK)	return (ERROR);    semTake (&partId->sem, WAIT_FOREVER);    /* go through free list and find largest free */    for (pNode = DLL_FIRST (&partId->freeList);	 pNode != NULL;	 pNode = DLL_NEXT (pNode))	{	pHdr = NODE_TO_HDR (pNode);	if (pHdr->nWords > biggestWords)	    biggestWords = pHdr->nWords;	}    semGive (&partId->sem);    return (2 * biggestWords - sizeof (BLOCK_HDR));    }/********************************************************************************* memPartAllocError - handle allocation error*/LOCAL void memPartAllocError     (    PART_ID pPart,    unsigned nBytes     )    {    if ((_func_logMsg != NULL) &&	(pPart->options & MEM_ALLOC_ERROR_LOG_FLAG))	(* _func_logMsg) (memMsgBlockTooBig, nBytes, (int) pPart, 0, 0, 0, 0);    }/********************************************************************************* memPartBlockError - handle invalid block error*/LOCAL void memPartBlockError     (    PART_ID pPart,    char *pBlock,    char *label     )    {    if ((_func_logMsg != NULL) &&        (pPart->options & MEM_BLOCK_ERROR_LOG_FLAG))        (* _func_logMsg) (memMsgBlockError, (int)label, (int) pBlock, 			  (int) pPart, 0, 0, 0);    }/******************************************************************************* memBlockSplit - split a block into two blocks** This routine splits the block pointed to into two blocks.  The second* block will have nWords words in it.  A pointer is returned to this block.* If either resultant block would end up having less than minWords in it,* NULL is returned.** RETURNS: A pointer to the second block, or NULL.*/LOCAL BLOCK_HDR *memBlockSplit     (    FAST BLOCK_HDR *pHdr,    unsigned nWords,            /* number of words in second block */    unsigned minWords           /* min num of words allowed in a block */    )    {    FAST unsigned wordsLeft;    FAST BLOCK_HDR *pNewHdr;    /* check if block can be split */    if ((nWords < minWords) ||        ((wordsLeft = (pHdr->nWords - nWords)) < minWords))        return (NULL);                  /* not enough space left */    /* adjust original block size and create new block */    pHdr->nWords = wordsLeft;    pNewHdr = NEXT_HDR (pHdr);    pNewHdr->pPrevHdr = pHdr;    pNewHdr->nWords   = nWords;    pNewHdr->free     = pHdr->free;    /* fix next block */    NEXT_HDR (pNewHdr)->pPrevHdr = pNewHdr;    return (pNewHdr);    }/********************************************************************************* memOptionsSet - set the debug options for the system memory partition** This routine sets the debug options for the system memory partition.* Two kinds of errors are detected:  attempts to allocate more memory than* is available, and bad blocks found when memory is freed.  In both cases,* the following options can be selected for actions to be taken when the error* is detected:  (1) return the error status, (2) log an error message and* return the error status, or (3) log an error message and suspend the* calling task.** These options are discussed in detail in the library manual* entry for memLib.** RETURNS: N/A** SEE ALSO: memPartOptionsSet()*/void memOptionsSet     (    unsigned options    /* options for system partition */    )    {    memPartOptionsSet (memSysPartId, options);    }/********************************************************************************* calloc - allocate space for an array (ANSI)** This routine allocates a block of memory for an array that contains* <elemNum> elements of size <elemSize>.  This space is initialized to* zeros.** RETURNS:* A pointer to the block, or NULL if the call fails.** SEE ALSO:* .I "American National Standard for Information Systems -"* .I "Programming Language - C, ANSI X3.159-1989: General Utilities (stdlib.h)"*/void *calloc     (    size_t elemNum,	/* number of elements */    size_t elemSize	/* size of elements */    )    {    FAST void *pMem;    FAST size_t nBytes = elemNum * elemSize;        if ((pMem = memPartAlloc (memSysPartId, (unsigned) nBytes)) != NULL)	bzero ((char *) pMem, (int) nBytes);    return (pMem);    }/********************************************************************************* realloc - reallocate a block of memory (ANSI)** This routine changes the size of a specified block of memory and returns a* pointer to the new block of memory.  The contents that fit inside the new* size (or old size if smaller) remain unchanged.  The memory alignment of* the new block is not guaranteed to be the same as the original block.** RETURNS:* A pointer to the new block of memory, or NULL if the call fails.** SEE ALSO:* .I "American National Standard for Information Systems -"* .I "Programming Language - C, ANSI X3.159-1989: General Utilities (stdlib.h)"*/void *realloc     (    void *pBlock,	/* block to reallocate */    size_t newSize	/* new block size */    )    {        return (memPartRealloc (memSysPartId, (char *) pBlock, 				(unsigned) newSize));    }/********************************************************************************* cfree - free a block of memory** This routine returns to the free memory pool a block of memory * previously allocated with calloc().** It is an error to free a memory block that was not previously allocated.** RETURNS: OK, or ERROR if the the block is invalid.*/STATUS cfree     (    char *pBlock        /* pointer to block of memory to free */    )    {    return (memPartFree (memSysPartId, pBlock));    }/********************************************************************************* memFindMax - find the largest free block in the system memory partition** This routine searches for the largest block in the system memory partition* free list and returns its size.** RETURNS: The size, in bytes, of the largest available block.** SEE ALSO: memPartFindMax()*/int memFindMax (void)    {    return (memPartFindMax (memSysPartId));    }/********************************************************************************* memSemInit - initialize the partition semaphore as type mutex** This routine initializes the partition semaphore as a mutex semaphore with* the mutex options stored in mutexOptionsMemLib.  This function is called* indirectly from memPartInit ().  This coupling allows alternative semaphore* types to serve as the basis for memory partition interlocking.*/LOCAL void memSemInit    (    PART_ID partId		/* partition to initialize semaphore for */    )    {    semMInit (&partId->sem, mutexOptionsMemLib);    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区高清在线| 91精品午夜视频| 国产.欧美.日韩| 美女爽到高潮91| 久久国产免费看| 国产精品99久久久久| 激情图片小说一区| 国产曰批免费观看久久久| 国产一区二区三区免费看| 国产美女久久久久| 成人一道本在线| 欧美伊人久久久久久久久影院 | 国产日韩精品久久久| 国产精品午夜久久| 亚洲一区在线观看网站| 日本午夜精品视频在线观看| 国产精品资源在线观看| 色综合久久中文综合久久97| 欧美久久一二三四区| 欧美激情在线看| 日本视频中文字幕一区二区三区 | 一本到不卡免费一区二区| 制服丝袜亚洲网站| 国产精品乱人伦中文| 日本午夜一本久久久综合| caoporn国产一区二区| 日韩欧美成人一区| 一区二区激情视频| 成人黄色777网| 国产日韩欧美一区二区三区乱码| 亚洲精品国产a久久久久久| 国产永久精品大片wwwapp| 欧美日韩国产成人在线91| 国产精品美女久久久久久久久 | 久久蜜臀中文字幕| 看片的网站亚洲| 欧美一区二区三区精品| 亚洲国产cao| 欧美日韩国产一二三| 午夜精品久久久久| 欧美一区二区黄| 欧美a级理论片| 精品电影一区二区三区| 久久精品久久99精品久久| 日韩一级高清毛片| 麻豆精品国产传媒mv男同| 日韩一区二区精品在线观看| 视频一区视频二区中文字幕| 日韩欧美国产麻豆| 国内不卡的二区三区中文字幕| 亚洲精品一区二区精华| 国产盗摄一区二区三区| 亚洲欧美电影院| 欧美日韩国产成人在线免费| 秋霞电影一区二区| 久久久久久久久久久久电影| 99久久伊人久久99| 午夜久久福利影院| 久久夜色精品国产噜噜av| gogo大胆日本视频一区| 喷白浆一区二区| 综合欧美亚洲日本| 精品sm捆绑视频| 欧美午夜片在线看| 国产乱一区二区| 性感美女极品91精品| 亚洲精品一区二区三区福利| 在线免费观看日韩欧美| 麻豆精品视频在线观看| 亚洲福利一二三区| 亚洲欧洲日韩综合一区二区| 欧美不卡一区二区三区| 欧美精品在线视频| 成人爱爱电影网址| 国产精品一品视频| 美女看a上一区| 亚洲一区免费在线观看| 中文字幕av在线一区二区三区| 884aa四虎影成人精品一区| 欧美在线免费播放| 色综合天天做天天爱| 99re这里都是精品| 懂色av一区二区三区蜜臀| 韩日欧美一区二区三区| 蜜桃精品视频在线| 蜜臀av一区二区三区| 日本美女一区二区| 久久精品国产秦先生| 久久99这里只有精品| 国产综合色在线| 成人丝袜高跟foot| 91麻豆精品国产91久久久久久久久| 在线播放亚洲一区| 精品在线观看视频| 久久久一区二区| 国产精品色在线| 亚洲女同一区二区| 一二三区精品福利视频| 视频一区二区欧美| 韩国欧美国产1区| 97久久精品人人做人人爽| 99精品国产91久久久久久| 欧美亚洲一区三区| 日韩欧美资源站| 亚洲欧洲精品天堂一级| 亚洲成a人在线观看| 国产在线精品免费| 91视频xxxx| 欧美成人欧美edvon| 亚洲精品国产品国语在线app| 美女视频黄久久| 色哟哟欧美精品| 国产欧美一区二区三区沐欲| 亚洲九九爱视频| 国产成人av资源| 日韩一区二区三区视频在线| 中文字幕一区二区不卡| 久久国产三级精品| 欧美性色黄大片手机版| 国产欧美日韩在线视频| 麻豆精品一区二区av白丝在线| 色综合中文字幕| 国产精品日日摸夜夜摸av| 久久精品国产精品青草| 91九色最新地址| 亚洲色图在线播放| 99久久免费精品高清特色大片| 久久久久国产精品麻豆| 精品伊人久久久久7777人| 91精品国产综合久久精品麻豆| 亚洲精品免费在线播放| 99久久婷婷国产精品综合| 最新欧美精品一区二区三区| 粉嫩绯色av一区二区在线观看| 久久女同性恋中文字幕| 看片的网站亚洲| 国产精品久久久久久妇女6080| 国产盗摄精品一区二区三区在线| 精品国产乱码久久久久久1区2区| 激情文学综合丁香| 久久精品一区二区| 91蜜桃婷婷狠狠久久综合9色| 一区二区三区免费| 制服视频三区第一页精品| 九一久久久久久| 国产精品视频第一区| 欧美网站一区二区| 极品美女销魂一区二区三区免费| 精品国产三级电影在线观看| av影院午夜一区| 日本中文字幕一区二区视频| 久久夜色精品国产欧美乱极品| 99精品一区二区三区| 天堂精品中文字幕在线| 日本一区二区免费在线观看视频| 99久免费精品视频在线观看| 蜜臀av亚洲一区中文字幕| 中文字幕亚洲在| 欧美一区二区三级| 色婷婷av一区| 粉嫩aⅴ一区二区三区四区 | 波多野洁衣一区| 麻豆精品在线看| 亚洲国产精品自拍| 中文字幕一区二区三中文字幕| 欧美人xxxx| 欧美午夜电影在线播放| 成人免费视频一区二区| 久久精品国产99国产精品| 亚洲综合在线免费观看| 欧美国产一区视频在线观看| 久久先锋资源网| 久久综合九色综合欧美就去吻 | 一区二区成人在线| 国产精品美女一区二区| 国产精品欧美经典| 日本一区二区免费在线观看视频 | 精品一区二区影视| 看片网站欧美日韩| 国产一区二区精品久久| 国产美女精品一区二区三区| 精彩视频一区二区三区| 国产一区二区三区免费播放| 国产精品一区专区| 99久久精品国产导航| 色综合久久综合网97色综合 | 理论电影国产精品| 国产一区二区三区美女| av在线这里只有精品| 欧美一二三四在线| 精品国产乱码久久久久久影片| 中文字幕不卡在线播放| 亚洲一二三四区| 黄色小说综合网站| 色一情一伦一子一伦一区| 欧美一三区三区四区免费在线看 | 色播五月激情综合网| 欧美日韩日日摸| 欧美国产精品一区二区三区| 亚洲在线观看免费|