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

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

?? memlib.c

?? vxworks源碼源碼解讀是學習vxworks的最佳途徑
?? C
?? 第 1 頁 / 共 3 頁
字號:
			          MEM_BLOCK_CHECK;	memLibInstalled = TRUE;	}    return ((memLibInstalled) ? OK : ERROR);    }/********************************************************************************* memInit - initialize the system memory partition** This routine initializes the system partition free list with the* specified memory block.  It must be called exactly once before invoking any* other routine in memLib.  It is called by kernelInit() in usrRoot()* in usrConfig.c.** RETURNS: OK or ERROR.** NOMANUAL*/STATUS memInit     (    char *pPool,        /* pointer to memory block */    unsigned poolSize   /* block size in bytes */    )    {    memLibInit ();		/* attach memLib functions to memPartLib */    return (memPartLibInit (pPool, poolSize));    }/********************************************************************************* memPartOptionsSet - set the debug options for a memory partition** This routine sets the debug options for a specified 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 error status is returned.  There are four error-handling* options that can be individually selected:* * .iP "MEM_ALLOC_ERROR_LOG_FLAG" 8* Log a message when there is an error in allocating memory.* .iP "MEM_ALLOC_ERROR_SUSPEND_FLAG"* Suspend the task when there is an error in allocating memory (unless* the task was spawned with the VX_UNBREAKABLE option, in which case it* cannot be suspended).* .iP "MEM_BLOCK_ERROR_LOG_FLAG"* Log a message when there is an error in freeing memory.* .iP "MEM_BLOCK_ERROR_SUSPEND_FLAG"* Suspend the task when there is an error in freeing memory (unless* the task was spawned with the VX_UNBREAKABLE option, in which case it* cannot be suspended).* .LP* * These options are discussed in detail in the library manual entry for* memLib.* * RETURNS: OK or ERROR.** ERRNO: S_smObjLib_NOT_INITIALIZED** SEE ALSO: smMemLib*/STATUS memPartOptionsSet     (    PART_ID  	partId,    /* partition to set option for */    unsigned  	options    /* memory management options */    )    {    if ((!memLibInstalled) && (memLibInit () != OK))	/* initialize package */	return (ERROR);    if (ID_IS_SHARED (partId))  /* partition is shared? */	{	if (smMemPartOptionsSetRtn == NULL)	    {	    errno = S_smObjLib_NOT_INITIALIZED;	    return (ERROR);	    }        return ((*smMemPartOptionsSetRtn)(SM_OBJ_ID_TO_ADRS (partId), options));	}    /* partition is local */    if (OBJ_VERIFY (partId, memPartClassId) != OK)	return (ERROR);    semTake (&partId->sem, WAIT_FOREVER);    /*     * Need to convert old-style options to new-style options     */    if (options & (MEM_ALLOC_ERROR_MASK | MEM_BLOCK_ERROR_MASK))	{	if (options & MEM_ALLOC_ERROR_LOG_MSG)	   options |= MEM_ALLOC_ERROR_LOG_FLAG;	if (options & MEM_ALLOC_ERROR_LOG_AND_SUSPEND)	    options |= (MEM_ALLOC_ERROR_LOG_FLAG |			MEM_ALLOC_ERROR_SUSPEND_FLAG);	if (options & MEM_BLOCK_ERROR_LOG_MSG)	   options |= MEM_BLOCK_ERROR_LOG_FLAG;	if (options & MEM_BLOCK_ERROR_LOG_AND_SUSPEND)	    options |= (MEM_BLOCK_ERROR_LOG_FLAG |			MEM_BLOCK_ERROR_SUSPEND_FLAG);	}    /*     * If either of the MEM_BLOCK options have been set, also set     * MEM_BLOCK_CHECK.     */    if (options & (MEM_BLOCK_ERROR_LOG_FLAG | MEM_BLOCK_ERROR_SUSPEND_FLAG))        options |= MEM_BLOCK_CHECK;        partId->options = options;    semGive (&partId->sem);    return (OK);    }/********************************************************************************* memalign - allocate aligned memory ** This routine allocates a buffer of size <size> from the system memory * partition.  Additionally, it insures that the allocated buffer begins * on a memory address evenly divisible by the specified alignment parameter.* The alignment parameter must be a power of 2.** RETURNS:* A pointer to the newly allocated block, or NULL if the buffer could not be* allocated.*/void *memalign     (    unsigned alignment,		/* boundary to align to (power of 2) */    unsigned size               /* number of bytes to allocate */    )    {    return (memPartAlignedAlloc (memSysPartId, size, alignment));    }/********************************************************************************* valloc - allocate memory on a page boundary ** This routine allocates a buffer of <size> bytes from the system memory* partition.  Additionally, it insures that the allocated buffer* begins on a page boundary.  Page sizes are architecture-dependent.** RETURNS:* A pointer to the newly allocated block, or NULL if the buffer could not be* allocated or the memory management unit (MMU) support library has not been* initialized.** ERRNO: S_memLib_PAGE_SIZE_UNAVAILABLE*/void * valloc     (    unsigned size	/* number of bytes to allocate */    )    {    int pageSize = VM_PAGE_SIZE_GET();    if (pageSize == ERROR)	{	errno = S_memLib_PAGE_SIZE_UNAVAILABLE;	return (NULL);	}    return (memalign (pageSize, size));    }/********************************************************************************* memPartRealloc - reallocate a block of memory in a specified partition** This routine changes the size of a specified block of memory and returns a* pointer to the new block.  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.** If <pBlock> is NULL, this call is equivalent to memPartAlloc().** RETURNS:* A pointer to the new block of memory, or NULL if the call fails.** ERRNO: S_smObjLib_NOT_INITIALIZED** SEE ALSO: smMemLib*/void *memPartRealloc     (    PART_ID partId,             /* partition ID */    char *pBlock,               /* block to be reallocated */    unsigned nBytes             /* new block size in bytes */    )    {    FAST BLOCK_HDR *pHdr = BLOCK_TO_HDR (pBlock);    FAST BLOCK_HDR *pNextHdr;    FAST unsigned nWords;    void *pNewBlock;    if (ID_IS_SHARED (partId))  /* partition is shared? */	{	if (smMemPartReallocRtn == NULL)	    {	    errno = S_smObjLib_NOT_INITIALIZED;	    return (NULL);	    }        return ((void *) (*smMemPartReallocRtn) (SM_OBJ_ID_TO_ADRS (partId), 						 pBlock, nBytes));	}    /* partition is local */    if (OBJ_VERIFY (partId, memPartClassId) != OK)	return (NULL);    /* Call memPartAlloc() if user passed us a NULL pointer */    if (pBlock == NULL)        return (memPartAlloc (partId, (unsigned) nBytes));       /* Call memPartFree() if nBytes=0 (SPR 5858) */    if (nBytes == 0)	{	(void) memPartFree (memSysPartId, pBlock);	return (NULL);	}    /* get exclusive access to the partition */    semTake (&partId->sem, WAIT_FOREVER);    /* get actual new size; round-up, add overhead, check for minimum */    nWords = (MEM_ROUND_UP (nBytes) + sizeof (BLOCK_HDR)) >> 1;    if (nWords < partId->minBlockWords)	nWords = partId->minBlockWords;    /* optional check for validity of block */    if ((partId->options & MEM_BLOCK_CHECK) &&        !memPartBlockIsValid (partId, pHdr, FALSE))	{	semGive (&partId->sem);			/* release mutual exclusion */	memPartBlockError (partId, pBlock, "memPartRealloc");	return (NULL);	}    /* test if we are trying to increase size of block */    if (nWords > pHdr->nWords)	{	/* increase size of block -	 * check if next block is free and is big enough to satisfy request*/	pNextHdr = NEXT_HDR (pHdr);	if (!pNextHdr->free || ((pHdr->nWords + pNextHdr->nWords) < nWords))	    {	    /* can't use adjacent free block -	     * allocate an entirely new block and copy data */	    semGive (&partId->sem);	    if ((pNewBlock = memPartAlloc (partId, nBytes)) == NULL)		return (NULL);	    bcopy (pBlock, (char *) pNewBlock,		   (int) (2 * pHdr->nWords - sizeof (BLOCK_HDR)));	    (void) memPartFree (partId, pBlock);	    return (pNewBlock);		/* RETURN, don't fall through */	    }	else	    {	    /* append next block to this one -	     *  - delete next block from freelist,	     *  - add its size to this block,	     *  - update allocation statistics,	     *  - fix prev info in new "next" block header */	    dllRemove (&partId->freeList, HDR_TO_NODE (pNextHdr));	    pHdr->nWords += pNextHdr->nWords;			/* fix size */#ifdef WV_INSTRUMENTATION	    /*	     * The following call to instrumentation will log an a greater	     * than needed nBytesPlusHeaderAlign. This is because, at this	     * point, nBytesPlusHeaderAlign includes the total size of the	     * newly freed memory block. The unused portion will be returned	     * to the free list (see memBlockSplit() just below, at which	     * time the excess will be logged as an EVENT_MEMFREE	     */	    EVT_OBJ_4 (OBJ, partId, memPartClassId, EVENT_MEMREALLOC,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色哟哟国产精品| 国产精品中文欧美| 在线电影院国产精品| 亚洲一卡二卡三卡四卡无卡久久 | 麻豆视频观看网址久久| 日韩一区二区影院| 精品系列免费在线观看| 久久男人中文字幕资源站| 丁香五精品蜜臀久久久久99网站| 1000精品久久久久久久久| 欧洲色大大久久| 日本一道高清亚洲日美韩| 2020国产成人综合网| 成人免费视频视频| 亚洲国产精品影院| 欧美精品一区二区三区一线天视频 | 偷拍自拍另类欧美| 精品999在线播放| 99riav久久精品riav| 一区二区三区国产| 欧美成人福利视频| av中文字幕不卡| 丝袜美腿成人在线| 国产精品天美传媒沈樵| 欧美日韩视频在线第一区| 老司机免费视频一区二区| 国产精品精品国产色婷婷| 欧美色精品在线视频| 国产精品白丝jk白祙喷水网站| 1024成人网| 久久午夜国产精品| 日本精品视频一区二区三区| 韩国三级在线一区| 亚洲国产视频一区二区| 久久久久免费观看| 欧美日韩高清不卡| 成人av手机在线观看| 免费一区二区视频| 最新不卡av在线| 精品少妇一区二区三区| 91福利精品视频| 国产福利一区二区三区在线视频| 天天综合网天天综合色| 亚洲图片你懂的| 国产亚洲精品bt天堂精选| 欧美日韩你懂的| 色噜噜狠狠成人中文综合| 国产成人午夜视频| 麻豆精品一二三| 丝袜诱惑亚洲看片| 一区二区在线观看免费| 国产清纯美女被跳蛋高潮一区二区久久w| 欧洲一区在线电影| 91黄色激情网站| 波多野结衣中文字幕一区二区三区| 精品一区二区免费看| 五月天中文字幕一区二区| 亚洲午夜一区二区三区| 国产精品超碰97尤物18| 久久久久高清精品| 精品久久久久久久人人人人传媒| 欧美精品色一区二区三区| 在线观看欧美精品| 色综合天天综合给合国产| fc2成人免费人成在线观看播放| 狠狠狠色丁香婷婷综合激情| 久久电影网站中文字幕| 蜜臀a∨国产成人精品| 欧美aⅴ一区二区三区视频| 午夜婷婷国产麻豆精品| 亚洲风情在线资源站| 亚洲欧美日韩国产综合| 自拍av一区二区三区| 中文字幕亚洲视频| 亚洲人成7777| 一区二区三区精品视频在线| 一区二区三区高清不卡| 亚洲一区在线观看免费观看电影高清| 亚洲免费观看视频| 亚洲最大成人综合| 五月激情六月综合| 老司机精品视频导航| 久国产精品韩国三级视频| 国产乱码一区二区三区| 国产99精品视频| 色又黄又爽网站www久久| 97精品久久久久中文字幕 | 色噜噜狠狠色综合欧洲selulu| 97久久久精品综合88久久| 91麻豆swag| 欧美日韩一本到| 欧美一区二区三区视频免费 | 欧美国产日韩a欧美在线观看| 国产欧美一区二区在线观看| 国产精品大尺度| 亚洲一区二区精品久久av| 日韩vs国产vs欧美| 国产精品中文欧美| 色婷婷久久久久swag精品 | www激情久久| 亚洲国产精品精华液ab| 亚洲日本在线a| 午夜精品一区二区三区电影天堂| 日本不卡视频在线| 国产成人免费av在线| 色诱视频网站一区| 日韩欧美一区中文| 国产精品第13页| 日韩av电影免费观看高清完整版| 国产一区二区视频在线| 99精品欧美一区二区蜜桃免费| 欧美日韩一区在线| 国产欧美精品国产国产专区| 一区二区三区四区五区视频在线观看| 五月天亚洲婷婷| 国产成人免费网站| 欧美日韩免费视频| 欧美激情在线一区二区三区| 亚洲一区二区在线观看视频| 国产一区二区不卡| 欧美三级资源在线| 久久久高清一区二区三区| 一区二区三区在线高清| 九九**精品视频免费播放| 色哟哟一区二区三区| 久久久www免费人成精品| 亚洲国产cao| bt7086福利一区国产| 精品久久久久久久久久久久包黑料 | 亚洲v精品v日韩v欧美v专区| 国产精品一区二区在线观看网站| 欧美在线小视频| 国产精品久久久久久久久动漫| 蜜桃视频在线观看一区| 91年精品国产| 国产日韩欧美一区二区三区综合 | 中文字幕亚洲一区二区va在线| 久久精品国产网站| 在线观看国产精品网站| 中文字幕在线一区免费| 国产在线不卡一卡二卡三卡四卡| 欧美中文字幕一区二区三区亚洲| 国产精品每日更新| 国内精品在线播放| 精品久久久久久久人人人人传媒| 亚洲高清免费观看高清完整版在线观看| 成人一级片在线观看| 2023国产精华国产精品| 免费欧美在线视频| 欧美日韩黄视频| 亚洲影院免费观看| 成人av在线电影| 国产欧美日韩视频在线观看| 久久精品国产99久久6| 777精品伊人久久久久大香线蕉| 亚洲精品第一国产综合野| 丁香啪啪综合成人亚洲小说| 精品国精品国产尤物美女| 久久精品国产久精国产| 精品日韩在线一区| 免费人成在线不卡| 欧美一级电影网站| 蜜臀av性久久久久蜜臀aⅴ四虎| 欧美一区中文字幕| 日韩av中文字幕一区二区| 欧美精品一二三| 奇米在线7777在线精品 | 成人免费va视频| 国产人成一区二区三区影院| 国产成人精品午夜视频免费| 国产清纯白嫩初高生在线观看91| 国产成人午夜视频| 一区二区理论电影在线观看| 色综合中文字幕国产| |精品福利一区二区三区| 91捆绑美女网站| 亚洲一区在线观看视频| 欧美日本在线视频| 日本va欧美va精品发布| 精品国产乱码久久久久久浪潮| 国产精品综合一区二区三区| 欧美精品一区二| 成人美女视频在线看| 亚洲少妇最新在线视频| 色八戒一区二区三区| 午夜精品久久久久久久久久久| 欧美一区三区四区| 国内精品久久久久影院薰衣草| 国产亚洲一二三区| 97久久精品人人做人人爽| 五月婷婷综合网| 久久久久久毛片| 91在线观看美女| 日本va欧美va瓶| 日本一区二区成人在线| 欧美日韩中文一区| 激情综合亚洲精品| 日韩美女视频一区二区 | 欧美不卡视频一区| 成人小视频免费观看|