亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
欧美日韩中文字幕一区| 国产精品女人毛片| 日韩免费一区二区| 一区二区三区欧美| 在线免费观看不卡av| 一区二区三区高清在线| 欧美三级日韩三级国产三级| 性感美女久久精品| 日韩欧美一区在线| 黄色小说综合网站| 国产精品看片你懂得| 91蜜桃网址入口| 亚洲成a人v欧美综合天堂下载| 欧美剧在线免费观看网站| 美女国产一区二区| 久久久99精品免费观看| 91原创在线视频| 日韩电影在线观看网站| 久久亚洲综合色| 色综合天天综合狠狠| 日韩国产一二三区| 久久精品亚洲乱码伦伦中文| 91亚洲永久精品| 日韩电影在线观看电影| 欧美高清在线视频| 欧美日韩一区精品| 国产成人精品亚洲午夜麻豆| 一区二区三区欧美久久| 精品国产免费一区二区三区四区 | 国产三级欧美三级日产三级99| 国产乱国产乱300精品| 亚洲欧洲av在线| 欧美一区二区国产| 9久草视频在线视频精品| 午夜av区久久| 中文字幕一区二区三区av | 69久久99精品久久久久婷婷| 国产麻豆视频一区| 亚洲成人自拍偷拍| 国产精品视频线看| 精品成人在线观看| 欧美午夜一区二区| 成av人片一区二区| 狠狠色丁香久久婷婷综合丁香| 亚洲一区成人在线| 亚洲欧洲无码一区二区三区| 日韩小视频在线观看专区| 色综合网站在线| 成人激情免费网站| 久久99九九99精品| 天堂成人国产精品一区| 亚洲免费伊人电影| 国产精品久久久久天堂| 精品日韩在线一区| 91精品久久久久久久久99蜜臂 | 欧美日韩国产免费| 91视频在线观看| 成人夜色视频网站在线观看| 麻豆成人免费电影| 日韩高清一区二区| 亚洲成人精品在线观看| 亚洲美女免费视频| 亚洲欧美激情小说另类| 国产精品成人免费在线| 久久久久久97三级| 国产午夜精品福利| 精品电影一区二区三区| 日韩女优制服丝袜电影| 日韩亚洲电影在线| 日韩欧美中文一区| 日韩欧美中文字幕一区| 日韩欧美一级精品久久| 欧美一区日本一区韩国一区| 91精品欧美久久久久久动漫| 在线不卡a资源高清| 欧美精品在线视频| 在线综合+亚洲+欧美中文字幕| 欧美丰满少妇xxxbbb| 欧美美女bb生活片| 欧美一区二区三区在线视频| 91精品国产色综合久久久蜜香臀| 欧美日韩成人综合天天影院| 欧美精品久久99| 91精品国产色综合久久不卡电影| 日韩美女视频在线| 日韩欧美国产小视频| 精品免费国产一区二区三区四区| 日韩女优av电影| 欧美激情一区不卡| 成人欧美一区二区三区黑人麻豆| 国产精品久久久久9999吃药| 日韩美女久久久| 亚洲最大的成人av| 亚洲成人7777| 免费成人在线观看视频| 国产自产高清不卡| av在线不卡免费看| 欧美最猛黑人xxxxx猛交| 欧美系列一区二区| 日韩精品一区二区三区在线| 欧美精品一区男女天堂| 欧美国产欧美亚州国产日韩mv天天看完整 | 欧美一区二区视频网站| 久久九九影视网| 一区二区三区四区在线播放| 免费高清视频精品| 成人app软件下载大全免费| 欧美亚洲图片小说| 精品国产免费视频| 亚洲视频一区在线观看| 日本成人在线一区| 国产成人av一区二区三区在线| 91丨九色porny丨蝌蚪| 91精品国产欧美一区二区18| 欧美精品一区二区三区在线播放 | av在线播放成人| 日韩一区二区三区视频在线观看 | 在线看日韩精品电影| 欧美xxx久久| 亚洲精品视频自拍| 黄页网站大全一区二区| 在线观看91精品国产入口| 久久久99精品免费观看不卡| 亚洲国产wwwccc36天堂| 成人涩涩免费视频| 欧美一区二区成人| 亚洲精品视频免费观看| 韩日av一区二区| 欧美日本韩国一区| 中文字幕视频一区| 国产真实精品久久二三区| 欧美亚洲一区二区三区四区| 中文字幕av一区二区三区| 亚洲成年人网站在线观看| 国产一区二区h| 欧美色视频在线观看| 国产成人精品影视| 欧美精品久久天天躁| 国产精品久久久久久久久晋中| 亚洲成人动漫精品| 成人av资源在线观看| 91麻豆精品91久久久久久清纯 | 在线看日韩精品电影| 久久久国产精品午夜一区ai换脸| 亚洲国产wwwccc36天堂| 成人天堂资源www在线| 欧美日本乱大交xxxxx| 久久久久久久久久久电影| 日本欧美大码aⅴ在线播放| gogo大胆日本视频一区| 精品久久久久久久久久久院品网| 亚洲精选视频免费看| 9色porny自拍视频一区二区| 欧美成人女星排名| 亚洲国产精品视频| 成人网在线播放| 久久久精品免费网站| 秋霞影院一区二区| 欧洲视频一区二区| 国产欧美一二三区| 久久er精品视频| 7878成人国产在线观看| 亚洲卡通欧美制服中文| 国产精品一区在线| 国产三级三级三级精品8ⅰ区| 奇米在线7777在线精品| 欧美在线免费播放| 国产精品久久久久久久浪潮网站| 丁香天五香天堂综合| 欧美成人女星排名| 日本成人中文字幕| 欧美日韩你懂的| 日韩成人午夜电影| 精品视频在线视频| 一区二区三区日韩在线观看| 成人动漫一区二区在线| 亚洲美女视频在线| 99国产精品久| 中文字幕一区不卡| 成人午夜av电影| 亚洲精品亚洲人成人网在线播放| 不卡在线视频中文字幕| 欧美极品xxx| av亚洲精华国产精华精| 国产精品久久久久久久裸模| 色爱区综合激月婷婷| 亚洲激情欧美激情| 欧美在线免费观看亚洲| 亚洲aaa精品| 欧美mv和日韩mv的网站| 天天av天天翘天天综合网| 欧美视频一区二区三区四区| 一区二区三区不卡视频在线观看 | 福利视频网站一区二区三区| 久久久国产午夜精品| 色综合天天性综合| 亚洲国产成人精品视频| 91精品国产高清一区二区三区| 亚洲综合丁香婷婷六月香| 欧美一级国产精品|