亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲欧美一区二区在线观看| 在线成人免费视频| 欧美国产禁国产网站cc| 国产剧情一区在线| 中文字幕第一区二区| 99国产精品久久久| 亚洲一二三四在线| 欧美日韩夫妻久久| 国内精品国产三级国产a久久| 久久综合久色欧美综合狠狠| 国产成人精品亚洲777人妖 | 国产精品欧美一区喷水| jlzzjlzz欧美大全| 亚洲国产aⅴ成人精品无吗| 91精品国产欧美一区二区18| 国产福利一区二区三区| 亚洲天堂a在线| 欧美一区二区视频在线观看2022 | 成人高清在线视频| 一区二区不卡在线播放| 欧美变态tickle挠乳网站| 成人午夜精品一区二区三区| 亚洲3atv精品一区二区三区| 久久嫩草精品久久久精品一| 91久久免费观看| 久久精品国产亚洲a| 亚洲欧洲av一区二区三区久久| 欧美性猛片xxxx免费看久爱| 麻豆精品一区二区三区| 亚洲人成影院在线观看| 欧美不卡一区二区| 91国偷自产一区二区三区成为亚洲经典| 亚洲国产精品久久久久秋霞影院| 26uuu色噜噜精品一区| 欧美综合久久久| 国产精品一区二区无线| 亚洲成人激情社区| 国产精品久久久久久久蜜臀| 91精品国产综合久久福利| 成人av网站在线| 麻豆久久一区二区| 亚洲高清免费视频| 国产精品久久久久久久久果冻传媒 | 最新中文字幕一区二区三区| 欧美xxxx在线观看| 欧美日韩精品欧美日韩精品| 99久久综合国产精品| 裸体一区二区三区| 亚洲国产日日夜夜| 国产精品久久一级| 国产日产欧美一区二区三区| 91精品国产综合久久香蕉的特点| 91在线视频观看| 丁香桃色午夜亚洲一区二区三区| 麻豆精品国产91久久久久久| 午夜激情一区二区| 亚洲国产综合视频在线观看| 亚洲欧美一区二区在线观看| 国产日韩影视精品| 精品国内片67194| 欧美一区二区三区在线看| 欧美三级电影一区| 欧美午夜在线一二页| 9人人澡人人爽人人精品| 国产乱人伦偷精品视频免下载| 麻豆精品一区二区三区| 蜜臀久久99精品久久久久宅男| 一区二区不卡在线视频 午夜欧美不卡在 | 亚洲成a天堂v人片| 亚洲小少妇裸体bbw| 亚洲夂夂婷婷色拍ww47| 亚洲精品免费播放| 亚洲免费观看视频| 亚洲人成亚洲人成在线观看图片 | 国产精品系列在线播放| 激情综合色播激情啊| 久久99精品久久久| 国内精品视频666| 国产老肥熟一区二区三区| 韩国女主播一区| 国产激情视频一区二区三区欧美 | 欧美电影免费观看高清完整版| 欧美性xxxxxxxx| 欧美日韩午夜影院| 欧美日韩国产片| 日韩午夜在线影院| 精品不卡在线视频| 国产亚洲成aⅴ人片在线观看| 国产午夜精品福利| 国产精品伦理在线| 亚洲视频免费看| 亚洲bdsm女犯bdsm网站| 另类的小说在线视频另类成人小视频在线 | 日韩一区二区视频| 久久久不卡网国产精品一区| 欧美激情一区二区三区蜜桃视频| 国产精品久久久久久久久免费相片 | 不卡一区二区中文字幕| 91精品91久久久中77777| 91精品国产综合久久久久久久久久| 欧美一级在线视频| 国产亲近乱来精品视频| 亚洲综合色成人| 毛片av一区二区| 成人福利视频在线看| 91九色02白丝porn| 日韩三级中文字幕| 国产精品久久久久天堂| 亚洲国产日韩一区二区| 韩国在线一区二区| 在线视频国内一区二区| 日韩免费在线观看| 18欧美亚洲精品| 日本在线不卡视频一二三区| 成人精品视频一区二区三区尤物| 91丨porny丨国产| 日韩视频中午一区| 亚洲免费观看高清| 国产在线视频精品一区| 日本韩国欧美一区二区三区| 精品福利在线导航| 樱桃国产成人精品视频| 国产自产v一区二区三区c| 91激情五月电影| 久久亚区不卡日本| 五月天婷婷综合| 99久久99久久精品免费看蜜桃| 91麻豆精品国产91久久久更新时间| 中文字幕二三区不卡| 日本欧美一区二区三区乱码| 97久久超碰精品国产| 精品久久一二三区| 亚洲一区二区三区小说| 成人网在线免费视频| 欧美电影精品一区二区| 亚洲自拍偷拍综合| 成人ar影院免费观看视频| 日韩欧美一级精品久久| 亚洲精品高清在线| 风间由美一区二区三区在线观看| 日韩天堂在线观看| 亚洲电影一级黄| 91亚洲大成网污www| 久久久精品国产免费观看同学| 日本三级亚洲精品| 欧美日韩精品欧美日韩精品| 亚洲精品成人a在线观看| 丁香另类激情小说| 久久色视频免费观看| 免费观看久久久4p| 69久久99精品久久久久婷婷| 亚洲福利视频导航| 欧美在线视频不卡| 一区二区三区高清| 91蜜桃免费观看视频| 国产精品久久久久天堂| 懂色av一区二区三区蜜臀| 久久久久久免费毛片精品| 青青草国产成人av片免费| 欧美裸体bbwbbwbbw| 亚洲一区二区三区免费视频| 94-欧美-setu| 亚洲日韩欧美一区二区在线| 成人免费视频一区| 国产精品乱码人人做人人爱 | 一区二区欧美精品| 91成人在线免费观看| 亚洲精品国产一区二区三区四区在线| 成人avav影音| 尤物av一区二区| 精品视频一区二区不卡| 性做久久久久久久免费看| 欧美另类z0zxhd电影| 日本成人中文字幕| 精品sm在线观看| 国产99久久久国产精品| 中文字幕一区二区三区不卡| av电影一区二区| 亚洲人成7777| 色久优优欧美色久优优| 亚洲超碰97人人做人人爱| 欧美嫩在线观看| 蜜桃一区二区三区在线| 久久人人爽爽爽人久久久| 成人午夜视频福利| 亚洲一区二区在线观看视频| 91精品国产麻豆国产自产在线| 久久国产尿小便嘘嘘| 日本一区二区视频在线| 91丨porny丨最新| 天使萌一区二区三区免费观看| 日韩精品一区国产麻豆| 国产传媒一区在线| 一区二区日韩av| 26uuu欧美| 在线看国产日韩| 激情深爱一区二区| 亚洲码国产岛国毛片在线| 91精品国产综合久久精品| 成熟亚洲日本毛茸茸凸凹|