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

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

?? memlib.c

?? vxworks源碼源碼解讀是學習vxworks的最佳途徑
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* memLib.c - full-featured memory partition manager *//* Copyright 1984-1995 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------05x,21feb99,jdi  doc: listed errnos.05w,01may98,cjtc moved instrumentation point in memPartRealloc to fix problem                 with reported size of bytesPlusHeaderAlign05v,17feb98,dvs  added instrumentation points (pr)05u,11feb97,dbt  Fixed case of memPartRealloc() call with pBlock = NULL (SPR                 #7012)05t,18jan96,tam  checked for nbBytes=0 in memPartRealloc() (SPR 5858).		 reworked the fix for memPartRealloc() (SPR 1407 & 3564).05s,23jan95,ism  Fixed possible problem with memPartRealloc() from earlier fix        	 (SPR#3563).  Fixed in-line docs.05r,23jan95,rhp  doc: explain memPartRealloc() with NULL pointer.05q,12jan95,rhp  doc: in memLib and memPartOptionsSet man pages, mention                 VX_UNBREAKABLE override of MEM_*_ERROR_SUSPEND_FLAG (SPR#2499)05p,29aug94,ism  memBlockSplit() bypasses the problem with the number of free        	 blocks statistic by incrementing before the memBlockSplit() 		 call (SPR #3564).05q,25aug94,ism  realloc() no longer checks for NULL block; instead, this is		 done at the next level down, in memPartRealloc() (SPR #3563).05p,05sep93,jcf  calls to logMsg are now indirect for scalability.05o,23feb93,jdi  documentation: cfree() not ANSI.05n,10feb93,jdi  fixed spelling of stdlib.05m,23jan93,jdi  documentation cleanup for 5.1.05l,13nov92,dnw  added include of smObjLib.h05k,20oct92,pme  added reference to shared memory manager documentation.05j,15oct92,pme  fixed valloc documentation.05i,02oct92,jdi  documentation cleanup.05h,23aug92,jcf  added _func_{memalign,valloc}05g,19aug92,smb  fixed SPR #1400, realloc(NULL) now malloc's memory05f,29jul92,pme  added NULL function pointer check for smObj routines.05e,29jul92,jcf  moved SUSPEND option to memPartLib.  beefed up package init.05d,19jul92,pme  added shared memory object support.05c,19jul92,smb  added some ANSI documentation.05b,13jul92,rdc  added valloc.05a,04jul92,jcf  split into memShow/memPartLib/memLib for modularity.04n,22jun92,rdc  added memalign and memPartAlignedAlloc.04m,26may92,rrr  the tree shuffle04l,07apr92,yao  removed macros MEM_ROUND_UP/DOWN, MEM_IS_ROUND.  04n,25mar92,jmm  Changed way we handle memory pool options for error handling04m,23mar92,jmm  changed memBlockAllocError to handle MEM_ALLOC_ERROR_RETURN                 changed memPartAllocError to handle MEM_ALLOC_ERROR_RETURN		 SPR #137704l,16dec91,gae  added includes for ANSI.04k,25nov91,llk  ansi stuff.  Modified malloc(), calloc(), realloc(), free().04j,04oct91,rrr  passed through the ansification filter                  -changed functions to ansi style		  -changed includes to have absolute path from h/		  -fixed #else and #endif		  -changed VOID to void		  -changed copyright notice04i,07aug91,ajm  made MIPS MEM_ROUNDUP use 8 byte boundaries for                   varargs problem.04h,23may91,jwt  forced 8-byte alignment for SPARC - stack, optimization.04g,13may91,wmd  added define for TRON rounding.04f,05apr91,jdi	 documentation -- removed header parens and x-ref numbers;		 doc review by dnw.04e,24mar91,del  added I960 rounding and padding to structures.04d,13feb91,jaa	 documentation cleanup.04c,05oct90,dnw  made memPartInit() be NOMANUAL.04b,18jul90,jcf  changed free/memPartFree to return OK if pBlock is NULL.04a,18jul90,jcf  changed partitions into objects w/ object class.		 change memPartBlockIsValid () to check validity w/o race.		 lint & cleanup.03i,26jun90,jcf  changed partition semaphore to mutex w/ inversion safety.03h,21nov89,jcf  added memSysPartId which is global variable for system part.03g,07nov89,shl  added error checking for memPartShow().		 fixed documentation on memory overhead.		 fixed memPart{Block,Alloc}Error() to not suspend		 unbreakable tasks.		 cosmetics.03f,15mar88,llk  fixed bug in realloc.  memBlockSplit() wasn't checking to		   ensure that both resulting blocks were of minimum length.03e,07nov88,gae  fixed memPartFindMax() return value in bytes not words.03d,18aug88,gae  documentation.03c,07jul88,jcf  lint.03b,22jun88,dnw  fixed bug in realloc.		 added cfree(), memPartFindMax(), and memFindMax().		 changed hdr to have ptr to prev block (instead of prev block		   size and free flag), as per gae suggestion.03a,20may88,dnw  rewritten - now has following features:		   - faster allocation		   - much faster deallocation (no searching)		   - checks validity of blocks being freed		   - options to specify how to deal with errors		   - always allocates on even 4 byte address		   - VxWorks v4 names02q,28mar88,gae  added calloc().02p,22jan88,jcf  made kernel independent.02o,19feb88,rdc  malloc of 0 bytes in no longer an error.02n,18nov87,dnw  changed to set S_memLib_INVALID_NBYTES appropriately.02m,17nov87,ecs  lint.02l,13nov87,gae  moved FRAGMENT definition here from memLib.h.		 fixed memFindMax() from returning too large an amount.02k,05nov87,jlf  documentation02j,23oct87,rdc  generalized to support private memory partitions.02i,07apr87,jlf  delinted.02h,24mar87,jlf  documentation.02g,30jan87,rdc  fixed bug in memAddToPool - was screwing up allocation stats.02f,21dec86,dnw  changed to not get include files from default directories.02e,04sep86,jlf  documentation.02d,02jul86,rdc  fixed bug in memStat.02c,19jun86,rdc  spruced up memStat.02b,18jun86,rdc  de-linted.02a,14apr86,rdc  completely rewritten to support dynamic allocation.01i,03mar86,jlf  added malloc and free.  free is a null routine, for now.01h,20jul85,jlf  Documentation.01g,08sep84,jlf  Changed to lock out while allocating memory.  added copyright		 and some comments.01f,13aug84,ecs  changed S_memLib_NO_MORE_MEMORY to S_memLib_NOT_ENOUGH_MEMORY.		 added testing for negative nbytes to memAllocate.		 added setting of status to S_memLib_INVALID_NBYTES.01e,07aug84,ecs  added setStatus call to memAllocate.01d,21may84,dnw  changed memInit to specify both start and end of pools.		 removed memEnd.		 added LINTLIBRARY and various coercions for lint.01c,03sep83,dnw  added memInit.01b,13jul83,dnw  fixed memAlloc to return NULL if insufficient memory available.01a,24may83,dnw  written*//*DESCRIPTIONThis library provides full-featured facilities for managing the allocationof blocks of memory from ranges of memory called memory partitions.  Thelibrary is an extension of memPartLib and provides enhanced memory managementfeatures, including error handling, aligned allocation, and ANSI allocationroutines.  For more information about the core memory partition management facility, see the manual entry for memPartLib.The system memory partition is created when the kernel is initializedby kernelInit(), which is called by the root task, usrRoot(), in usrConfig.c.The ID of the system memory partition is stored in the global variable`memSysPartId'; its declaration is included in memLib.h.The memalign() routine is provided for allocating memory aligned to a specifiedboundary.This library includes three ANSI-compatible routines:calloc() allocates a block of memory for an array;realloc() changes the size of a specified block of memory; andcfree() returns to the free memory pool a block of memory thatwas previously allocated with calloc().ERROR OPTIONSVarious debug options can be selected for each partition usingmemPartOptionsSet() and memOptionsSet().  Two kinds of errors are detected: attempts to allocate more memorythan is available, and bad blocks found when memory is freed.  In bothcases, the error status is returned.  There are four error-handlingoptions that can be individually selected:.iP "MEM_ALLOC_ERROR_LOG_FLAG" 8Log 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 (unlessthe task was spawned with the VX_UNBREAKABLE option, in which case itcannot 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 (unlessthe task was spawned with the VX_UNBREAKABLE option, in which case itcannot be suspended)..LPWhen the following option is specified to check every block freed to thepartition, memPartFree() and free() in memPartLib run consistency checksof various pointers and values in the header of the block being freed.  Ifthis flag is not specified, no check will be performed when memory isfreed..iP "MEM_BLOCK_CHECK" 8Check each block freed..LPSetting either of the MEM_BLOCK_ERROR options automatically sets MEM_BLOCK_CHECK.The default options when a partition is created are:    MEM_ALLOC_ERROR_LOG_FLAG    MEM_BLOCK_CHECK    MEM_BLOCK_ERROR_LOG_FLAG    MEM_BLOCK_ERROR_SUSPEND_FLAGWhen setting options for a partition with memPartOptionsSet() ormemOptionsSet(), use the logical OR operator between each specifiedoption to construct the <options> parameter.  For example:.CS    memPartOptionsSet (myPartId, MEM_ALLOC_ERROR_LOG_FLAG |                                 MEM_BLOCK_CHECK |                                 MEM_BLOCK_ERROR_LOG_FLAG);.CEINCLUDE FILES: memLib.hSEE ALSO: memPartLib, smMemLibINTERNALThis package is initialized by kernelInit() which calls memInit() with apointer to a block of memory from which memory will be allocated.Blocks allocated by malloc() are actually larger than the size requested bythe user.  Each block is prefaced by a header which contains the size andstatus of that block and a pointer to the previous block.The pointer returned to the user points just past this header.Likewise when a block is freed, the header is found just in front ofthe block pointer passed by the user.The header data is arranged so that the pointer to the previous blockcomes first and is therefore adjacent to that previous block.  Thus eachblock has 4 bytes of redundant information on either side of it (the 4bytes of size and status before it in its own header, and the 4-bytepointer after it in the next header).  This redundant information isoptionally used in free() and realloc() to make a consistency check onblocks specified by the user.  This mechanism helps to detect two commonerrors: (1) bad block pointers passed to free() or realloc() are usuallydetected, and (2) trashing up to 4 bytes on either side of the block willonly affect that block and will also be detected by free() or realloc().There is a minimum block size which malloc() allocates; this is to insurethat there will be enough room for the free list links that must be usedwhen the block is freed if it cannot be coalesced with an adjacent block.The malloc() and realloc() routines always allocate memory aligned to the boundary defined in the global variable memDefaultAlignment, which is initialized to the alignment required for the specific architecture.The memory partition semaphore is a structure in the partition descriptorrather than a pointer to a dynamically created semaphore structure.This is because of the chicken-and-the-egg problem of memLib using semaphoresand semCreate calling malloc.  Instead the structure is simply declareddirectly in the partition structure and we call semInit() instead ofsemCreate().*/#include "vxWorks.h"#include "semLib.h"#include "dllLib.h"#include "logLib.h"#include "taskLib.h"#include "stdlib.h"#include "stdio.h"#include "string.h"#include "errno.h"#include "smObjLib.h"#include "private/memPartLibP.h"#include "private/vmLibP.h"#include "private/smMemLibP.h"#include "private/funcBindP.h"#include "private/eventP.h"/* global variables */int mutexOptionsMemLib = SEM_Q_PRIORITY | 	/* default mutual exclusion */			 SEM_DELETE_SAFE |	/* options for memory */			 SEM_INVERSION_SAFE;	/* partition semaphore *//* shared memory manager function pointers */FUNCPTR  smMemPartOptionsSetRtn;FUNCPTR  smMemPartFindMaxRtn;FUNCPTR  smMemPartReallocRtn;/* local variables */LOCAL BOOL  memLibInstalled;		/* TRUE if library has been installed */LOCAL char *memMsgBlockTooBig =	"memPartAlloc: block too big - %d in partition %#x.\n";LOCAL char *memMsgBlockError =	"%s: invalid block %#x in partition %#x.\n";/* forward static functions */static void memSemInit (PART_ID pPart);static void memPartAllocError (PART_ID pPart, unsigned nBytes);static void memPartBlockError (PART_ID pPart, char *pBlock, char *label);static BLOCK_HDR *memBlockSplit (BLOCK_HDR *pHdr, unsigned nWords,				 unsigned minWords);/********************************************************************************* memLibInit - initialize the higher level memory management functions** This routine initializes the higher level memory management functions* suchas mutex semaphore selection, and error notification.** RETURNS: OK or ERROR.** NOMANUAL*/STATUS memLibInit (void)    {    if (!memLibInstalled)	{	_func_valloc	     	= (FUNCPTR) valloc;	_func_memalign	     	= (FUNCPTR) memalign;	memPartBlockErrorRtn  	= (FUNCPTR) memPartBlockError;	memPartAllocErrorRtn  	= (FUNCPTR) memPartAllocError;	memPartSemInitRtn     	= (FUNCPTR) memSemInit;    	memPartOptionsDefault	= MEM_ALLOC_ERROR_LOG_FLAG |			          MEM_BLOCK_ERROR_LOG_FLAG |			          MEM_BLOCK_ERROR_SUSPEND_FLAG |

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一卡二卡在线观看| 亚洲精品乱码久久久久久 | 欧美在线三级电影| 成人在线综合网| 国产成人精品一区二区三区四区| 国内外成人在线| 国产精品一区二区久激情瑜伽| av成人免费在线观看| 国产凹凸在线观看一区二区| 国产成人精品亚洲777人妖| 国产一区欧美二区| 成人蜜臀av电影| 99精品欧美一区二区三区小说| 91丝袜美腿高跟国产极品老师| 91一区一区三区| 91精品欧美综合在线观看最新| 7878成人国产在线观看| 精品久久久久久久久久久久久久久久久 | 五月天亚洲精品| 蜜臀久久久99精品久久久久久| 久久国产乱子精品免费女| 蜜桃视频一区二区三区 | 欧美激情一区二区三区不卡 | 日韩精品一区二区三区四区| 精品国产一区二区三区不卡| 国产午夜久久久久| 亚洲人成小说网站色在线| 丝袜诱惑制服诱惑色一区在线观看| 日韩av一区二| 国产精品亚洲成人| 欧美性xxxxxxxx| 精品免费日韩av| 亚洲欧洲三级电影| 视频一区二区国产| 99久久精品99国产精品 | 亚洲精品一线二线三线| 中文字幕国产一区二区| 一区二区三区在线播| 麻豆国产精品一区二区三区| 成人h动漫精品| 日韩欧美电影在线| 亚洲蜜臀av乱码久久精品蜜桃| 蜜桃一区二区三区四区| 中文字幕一区视频| 精品影视av免费| 欧美性受xxxx黑人xyx性爽| 精品国产亚洲一区二区三区在线观看| 国产精品久久久一区麻豆最新章节| 日韩二区三区在线观看| 99re这里只有精品视频首页| 精品伦理精品一区| 伊人性伊人情综合网| 成人在线综合网站| 精品免费日韩av| 亚洲一区二区在线视频| 成人免费av网站| 久久―日本道色综合久久| 日韩国产在线观看| 精品污污网站免费看| 最新不卡av在线| 国产.欧美.日韩| 久久只精品国产| 蜜臀久久99精品久久久久久9 | 26uuu国产在线精品一区二区| 午夜精品福利一区二区三区av | 日韩小视频在线观看专区| 亚洲国产成人精品视频| 成人精品国产一区二区4080| 久久综合狠狠综合久久激情| 久久国产精品99久久久久久老狼| 欧美三级视频在线观看| 亚洲一级不卡视频| 在线观看国产91| 亚洲自拍另类综合| 欧洲精品中文字幕| 亚洲免费观看高清完整版在线观看熊 | 91麻豆免费在线观看| 国产女人18毛片水真多成人如厕| 经典三级一区二区| 精品国产免费久久| 九九国产精品视频| 国产色91在线| 成人午夜精品在线| 1024国产精品| 精品乱码亚洲一区二区不卡| 美女性感视频久久| 26uuu精品一区二区三区四区在线| 麻豆精品一区二区av白丝在线| 欧美大片日本大片免费观看| 久久不见久久见免费视频1| 欧美电视剧在线看免费| 国产精品77777| 国产精品无码永久免费888| 97se亚洲国产综合自在线不卡| 亚洲欧美日韩国产中文在线| 欧美在线免费观看亚洲| 奇米在线7777在线精品| 久久久影院官网| 北条麻妃国产九九精品视频| 亚洲精选在线视频| 欧美日韩国产高清一区二区| 久久99精品久久久| 最新中文字幕一区二区三区| 欧美性猛片xxxx免费看久爱| 久久99热这里只有精品| 中文字幕va一区二区三区| 99re这里只有精品6| 亚洲无人区一区| 精品国产凹凸成av人导航| 国产黄色精品网站| 亚洲乱码一区二区三区在线观看| 欧美性猛交xxxxxxxx| 久久激情综合网| 亚洲欧洲日韩女同| 欧美人妖巨大在线| 国产精品一区二区黑丝| 亚洲精品视频免费观看| 久久伊人蜜桃av一区二区| 色婷婷综合在线| 狠狠网亚洲精品| 一区二区三区高清在线| 久久综合狠狠综合久久激情| 91美女视频网站| 国产精品18久久久久久久久久久久 | 制服丝袜一区二区三区| 风间由美一区二区av101| 美女诱惑一区二区| 一区二区三区欧美激情| 久久综合色一综合色88| 4hu四虎永久在线影院成人| 不卡的电视剧免费网站有什么| 美女视频黄 久久| 一区二区三区中文字幕电影| 国产精品美女久久久久久2018| 欧美精品在线一区二区三区| 欧美日韩国产一级二级| 国产91精品入口| 日本色综合中文字幕| 亚洲一区二区三区视频在线播放| 国产欧美一区二区三区沐欲| 7777精品伊人久久久大香线蕉完整版| 99久久国产综合精品女不卡| 国内外成人在线| 免费成人在线影院| 日韩精品亚洲一区二区三区免费| 亚洲另类春色校园小说| 欧美国产精品久久| 久久精品网站免费观看| 欧美xxxxxxxxx| 日韩欧美在线一区二区三区| 欧美丝袜丝交足nylons图片| 成人av动漫在线| 成人午夜在线免费| 成人国产精品免费观看动漫| 国产精品亚洲视频| 国产经典欧美精品| 国产精品资源站在线| 韩国av一区二区| 国产精品中文有码| 国产成人在线视频免费播放| 国内精品在线播放| 国产.精品.日韩.另类.中文.在线.播放| 国产麻豆视频精品| 成人午夜碰碰视频| 91久久免费观看| 欧美日韩国产综合一区二区三区 | 免费欧美在线视频| 国产传媒一区在线| 99精品国产99久久久久久白柏 | 这里只有精品视频在线观看| 欧美日韩精品是欧美日韩精品| 91麻豆精品国产91久久久资源速度 | 久久精品亚洲麻豆av一区二区| 欧美激情一区二区三区全黄| 中文字幕亚洲区| 亚洲综合一区二区三区| 五月婷婷综合网| 激情欧美一区二区三区在线观看| 国产精品18久久久久久久网站| 成人精品国产一区二区4080| av在线综合网| 制服丝袜亚洲播放| 日韩精品一区二区三区四区视频 | 午夜精品久久久久久久久| 久久国产三级精品| 色综合久久天天| 91超碰这里只有精品国产| 久久久久久久久久看片| 日韩av在线免费观看不卡| 国产福利一区二区三区视频在线| 色婷婷精品大在线视频| 日韩一区二区在线观看视频播放| 中文字幕精品在线不卡| 日本成人在线电影网| 国产成a人亚洲精品| 91精品免费在线| 亚洲欧美经典视频| 国模大尺度一区二区三区| 欧美私人免费视频| 亚洲欧洲日韩av|