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

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

?? memlib.c

?? 操作系統開發,vxwork操作系統源代碼
?? 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ⅴ免费视频一区二区三区| 26uuu亚洲综合色欧美| ...中文天堂在线一区| 国产成人日日夜夜| 中文字幕乱码一区二区免费| 成人精品鲁一区一区二区| 国内一区二区在线| 精品国产乱码久久久久久久久| 久久99精品国产.久久久久久| 日韩免费性生活视频播放| 国产一区二区精品久久99| 国产欧美一区二区精品性| 不卡高清视频专区| 亚洲自拍偷拍欧美| 欧美一区日韩一区| 成人一区二区三区| 五月婷婷综合激情| 久久午夜电影网| 91浏览器在线视频| 蜜臀国产一区二区三区在线播放 | 欧美日韩国产高清一区二区三区 | 国产中文字幕精品| 17c精品麻豆一区二区免费| 欧美日韩色综合| 青青国产91久久久久久 | 精品精品欲导航| 成人午夜视频免费看| 爽好久久久欧美精品| 国产亚洲1区2区3区| 欧美午夜宅男影院| 国产另类ts人妖一区二区| 洋洋成人永久网站入口| 精品国产3级a| 欧美亚洲精品一区| 国产超碰在线一区| 天堂精品中文字幕在线| 中文字幕在线观看一区| 日韩欧美国产综合| 在线影院国内精品| 国产福利91精品一区二区三区| 亚洲国产成人av好男人在线观看| 国产区在线观看成人精品| 欧美精品视频www在线观看| 成人国产一区二区三区精品| 免费在线观看一区| 亚洲高清不卡在线观看| 久久精品亚洲国产奇米99| 欧美日韩成人在线一区| 色综合天天天天做夜夜夜夜做| 国产精品亚洲综合一区在线观看| 婷婷一区二区三区| 亚洲蜜臀av乱码久久精品| 久久九九久久九九| 精品国精品国产| 7777精品伊人久久久大香线蕉 | 亚洲高清免费观看| 最新欧美精品一区二区三区| 国产片一区二区三区| 日韩一区二区三区四区| 欧美日精品一区视频| 91小视频在线| 97精品视频在线观看自产线路二| 国产麻豆精品在线| 国产乱淫av一区二区三区| 蜜臀av性久久久久蜜臀av麻豆| 亚洲国产一区视频| 亚洲黄色片在线观看| 亚洲欧洲日本在线| 中文字幕在线不卡一区| 中文字幕不卡在线播放| 欧美精彩视频一区二区三区| 久久久91精品国产一区二区三区| 久久这里只精品最新地址| 精品国产凹凸成av人网站| 日韩精品资源二区在线| 欧美一区二区三区四区高清| 91精品国产综合久久精品| 91精品国产高清一区二区三区蜜臀| 欧美精品在欧美一区二区少妇| 欧美日韩一级片网站| 欧美日韩国产一级二级| 777午夜精品免费视频| 6080午夜不卡| 欧美哺乳videos| 久久久精品tv| 国产精品久久一卡二卡| 亚洲欧美另类小说| 午夜久久久久久久久| 日本成人在线看| 国产在线一区二区综合免费视频| 精品一区在线看| 国产99一区视频免费| 一本一道波多野结衣一区二区| 在线精品国精品国产尤物884a| 精品视频全国免费看| 欧美一区三区二区| 久久久久久久免费视频了| 国产精品久久久99| 亚洲国产美女搞黄色| 久久国产精品99久久人人澡| 国产成人自拍高清视频在线免费播放 | 欧美猛男gaygay网站| 精品国产制服丝袜高跟| 国产精品久久久久一区二区三区| 亚洲天堂av一区| 肉肉av福利一精品导航| 国产99久久久久久免费看农村| 色先锋资源久久综合| 日韩欧美高清dvd碟片| 欧美激情一区二区三区不卡 | 一级做a爱片久久| 免费成人在线观看| 成人一二三区视频| 欧美高清你懂得| 国产精品久久久久久久久免费桃花 | 中文字幕av不卡| 亚洲一区二区在线观看视频| 麻豆成人久久精品二区三区红 | 日本道免费精品一区二区三区| 在线播放视频一区| 国产精品色一区二区三区| 婷婷成人综合网| 成人性色生活片| 91精品国产高清一区二区三区 | 性做久久久久久| 成人少妇影院yyyy| 欧美一区二区三区播放老司机| 国产精品美日韩| 美国毛片一区二区| 日本精品一区二区三区高清| 久久精品欧美日韩精品| 丝袜美腿亚洲色图| 97国产一区二区| 久久久久97国产精华液好用吗| 午夜成人免费视频| 99精品欧美一区二区蜜桃免费| 欧美大片一区二区| 亚洲444eee在线观看| aaa欧美色吧激情视频| 26uuu久久综合| 日本aⅴ精品一区二区三区| 色综合天天综合网国产成人综合天| 久久一留热品黄| 青青草97国产精品免费观看 | 亚洲五码中文字幕| 97精品国产露脸对白| 欧美激情艳妇裸体舞| 久久国产精品72免费观看| 欧美日韩精品一区二区天天拍小说| 最新不卡av在线| 不卡免费追剧大全电视剧网站| 久久精品一区蜜桃臀影院| 精品一区精品二区高清| 884aa四虎影成人精品一区| 亚洲最大色网站| 欧美中文字幕久久| 亚洲三级理论片| 99久久国产综合精品女不卡| 国产精品久久毛片| 成人va在线观看| 日韩一区中文字幕| 91网站最新网址| 最好看的中文字幕久久| 92精品国产成人观看免费| 国产精品精品国产色婷婷| 99在线精品视频| 亚洲免费av在线| 欧美日韩午夜精品| 日本欧美加勒比视频| 日韩三级av在线播放| 精品在线免费观看| 国产日韩视频一区二区三区| 岛国一区二区在线观看| 国产精品久久久久久久久久久免费看 | 成人性视频免费网站| 国产精品午夜春色av| 99久久99久久精品免费观看| 亚洲视频精选在线| 日本高清视频一区二区| 天天综合天天综合色| 日韩欧美在线影院| 精品一区二区三区免费| 国产午夜精品一区二区三区嫩草| 国产suv精品一区二区883| 1区2区3区国产精品| 欧美日韩视频在线观看一区二区三区| 性感美女极品91精品| 精品欧美一区二区久久| 成人成人成人在线视频| 一区二区三区蜜桃网| 日韩一级成人av| 丁香天五香天堂综合| 亚洲综合视频在线观看| 91精品国产一区二区三区蜜臀| 国产一区在线看| 亚洲精品日日夜夜| 日韩欧美一级精品久久| 高清视频一区二区| 亚洲国产综合在线| 精品国产乱码久久久久久蜜臀 |