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

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

?? memlib.c

?? 大名鼎鼎的嵌入式操作系統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一区二区三区免费野_久草精品视频
欧洲精品一区二区三区在线观看| 欧美色涩在线第一页| 国产精品不卡在线观看| 欧美日韩国产综合草草| 国产成a人亚洲精品| 三级久久三级久久久| 亚洲日本青草视频在线怡红院 | 色婷婷综合视频在线观看| 美女高潮久久久| 亚洲国产成人av网| 亚洲私人影院在线观看| 国产偷v国产偷v亚洲高清| 日韩欧美国产一区二区在线播放| 91久久精品国产91性色tv| 国产91在线观看丝袜| 精品一区二区日韩| 五月天一区二区| 一区二区在线观看免费| 中文字幕视频一区| 久久精品欧美日韩| 亚洲精品一区二区三区精华液| 欧美乱熟臀69xxxxxx| 欧美中文一区二区三区| 91亚洲精华国产精华精华液| 国产aⅴ综合色| 国产精品99久久久久久似苏梦涵 | 午夜免费欧美电影| 尤物在线观看一区| 亚洲欧美电影院| 亚洲三级小视频| 国产一区二区三区日韩 | 91亚洲国产成人精品一区二区三| 国产精品资源在线| 国产一区二区三区在线观看精品| 精品一区二区三区视频在线观看 | 日韩美一区二区三区| 91精品国产综合久久蜜臀| 欧美日韩国产一级片| 在线观看不卡视频| 欧美人体做爰大胆视频| 欧美午夜一区二区| 精品视频一区三区九区| 欧美高清一级片在线| 欧美日韩一级视频| 日韩亚洲欧美高清| 精品国产电影一区二区| 久久久午夜精品| 国产精品入口麻豆九色| 国产精品毛片久久久久久久| 中文字幕日韩欧美一区二区三区| 亚洲欧洲色图综合| 亚洲激情图片小说视频| 亚洲线精品一区二区三区八戒| 丝瓜av网站精品一区二区| 秋霞电影一区二区| 国产成人在线影院 | 在线观看91精品国产麻豆| 91精品国产综合久久福利软件| 日韩三级免费观看| 久久蜜桃香蕉精品一区二区三区| 欧美韩国日本一区| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 亚洲视频一二三| 亚洲成a人片在线不卡一二三区 | 亚洲国产高清不卡| 亚洲激情欧美激情| 蜜桃av一区二区| aaa欧美日韩| 在线免费观看日本一区| 日韩三级免费观看| 国产精品欧美精品| 午夜精品福利久久久| 国产一区三区三区| 欧洲精品在线观看| 久久久久久久久99精品| 福利电影一区二区三区| 日本韩国欧美国产| 久久午夜色播影院免费高清| 亚洲日本va午夜在线电影| 日韩成人av影视| 成人国产精品免费网站| 欧美一级理论性理论a| 国产精品丝袜久久久久久app| 亚洲国产综合视频在线观看| 国产在线不卡视频| 欧美在线不卡一区| 国产色爱av资源综合区| 日韩高清不卡一区二区| 99久久99久久精品国产片果冻| 在线播放亚洲一区| 亚洲图片激情小说| 国产一区二区三区四区在线观看| 欧美亚男人的天堂| 中文子幕无线码一区tr| 日本欧洲一区二区| 色综合天天综合网国产成人综合天| 日韩一级大片在线观看| 亚洲国产人成综合网站| av午夜精品一区二区三区| 日韩精品在线一区| 亚洲成人免费视| 91丨porny丨国产入口| 久久久久国产免费免费| 免费在线一区观看| 欧美日韩一区二区不卡| 亚洲欧美激情小说另类| 成人免费毛片aaaaa**| 精品久久免费看| 日韩av一级片| 欧美日韩激情一区| 亚洲午夜影视影院在线观看| 99视频热这里只有精品免费| 久久青草欧美一区二区三区| 日本不卡123| 欧美一区二区三区免费观看视频| 亚洲免费观看高清| 91免费版在线看| 国产精品久久久久7777按摩| 国产中文一区二区三区| 亚洲精品在线网站| 狠狠色综合日日| 久久亚洲影视婷婷| 国产一区二区三区在线看麻豆| 日韩三级精品电影久久久 | 另类小说综合欧美亚洲| 69av一区二区三区| 婷婷国产在线综合| 欧美人动与zoxxxx乱| 亚洲国产精品一区二区尤物区| 在线观看欧美精品| 亚洲香肠在线观看| 欧美精品亚洲一区二区在线播放| 亚洲成a人在线观看| 欧美日韩中文精品| 日韩成人午夜精品| 日韩免费高清视频| 黄色日韩网站视频| 国产欧美一区二区三区沐欲| 成人精品一区二区三区四区| 国产欧美综合在线| 99国产精品国产精品毛片| 亚洲欧洲综合另类| 欧美日韩激情一区二区三区| 日韩av一二三| 精品成人免费观看| 国产精品一区二区不卡| 国产精品嫩草影院av蜜臀| 99久久亚洲一区二区三区青草| 亚洲欧洲韩国日本视频| 色婷婷综合久久久久中文一区二区 | 欧美国产一区在线| 白白色亚洲国产精品| 亚洲一区二区偷拍精品| 欧美精品aⅴ在线视频| 久久精品国产精品亚洲精品| 久久久久久免费毛片精品| 成人午夜私人影院| 亚洲综合一区在线| 91麻豆精品国产91久久久久久| 久久av老司机精品网站导航| 国产人成一区二区三区影院| 一本到高清视频免费精品| 丝袜美腿亚洲色图| 久久午夜色播影院免费高清| 91蝌蚪porny| 日韩高清不卡在线| 欧美激情在线一区二区| 欧美日本国产视频| 国产一区二区不卡在线| 亚洲乱码国产乱码精品精小说| 717成人午夜免费福利电影| 精品一区二区三区在线观看| 亚洲人成人一区二区在线观看| 91精品国产麻豆| 成人性生交大片免费看中文网站| 亚洲图片欧美一区| 久久久久青草大香线综合精品| 在线视频一区二区三区| 国产一区二区精品久久99| 亚洲黄色小说网站| 久久夜色精品国产噜噜av| 欧美性生交片4| 国产成人精品影视| 亚洲不卡一区二区三区| 国产日韩三级在线| 欧美精品视频www在线观看| 粉嫩av一区二区三区| 日韩av不卡在线观看| 中文字幕一区二区三区在线不卡| 91麻豆精品国产91久久久 | 精品国偷自产国产一区| 韩国成人精品a∨在线观看| 日韩久久一区二区| 成人性色生活片| 亚洲精品高清在线| 国产二区国产一区在线观看| 亚洲男人的天堂网| 国产亚洲成av人在线观看导航| 欧美日韩久久久| 91一区二区在线|