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

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

?? memlib.c

?? 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一区二区三区免费野_久草精品视频
豆国产96在线|亚洲| 亚洲一区欧美一区| 国产米奇在线777精品观看| 欧美日本一区二区| 天堂蜜桃91精品| 欧美一区二区性放荡片| 三级一区在线视频先锋| 欧美成人官网二区| 国产ts人妖一区二区| 国产日产精品1区| 成人午夜看片网址| 一级女性全黄久久生活片免费| 欧美色窝79yyyycom| 免费视频一区二区| 国产欧美精品一区aⅴ影院 | 69av一区二区三区| 看电影不卡的网站| 国产欧美日本一区视频| 色综合激情五月| 男女性色大片免费观看一区二区 | 狠狠色狠狠色综合系列| 国产欧美日韩三级| 色综合久久久久网| 日本亚洲免费观看| 国产日韩欧美a| 欧美丝袜丝nylons| 国产又黄又大久久| 亚洲精品v日韩精品| 精品国产免费人成在线观看| 99久久精品情趣| 奇米影视在线99精品| 国产精品女人毛片| 欧美老肥妇做.爰bbww视频| 国产一区二区看久久| 亚洲综合激情另类小说区| 精品国产a毛片| 色呦呦国产精品| 国产一区二区0| 香蕉久久一区二区不卡无毒影院| 久久久久久久久久久电影| 欧美亚洲愉拍一区二区| 日韩高清国产一区在线| 日韩激情一二三区| 久久精品国产免费| 综合电影一区二区三区 | 欧美日韩一区二区欧美激情| 国产一区二区在线看| 亚洲自拍与偷拍| 国产色爱av资源综合区| 5858s免费视频成人| eeuss国产一区二区三区| 激情综合色播激情啊| 亚洲高清不卡在线| 亚洲视频一区二区免费在线观看| 精品日韩成人av| 在线播放亚洲一区| 日本精品视频一区二区| proumb性欧美在线观看| 国产伦精一区二区三区| 日本午夜精品一区二区三区电影| 亚洲激情五月婷婷| 亚洲婷婷国产精品电影人久久| 国产欧美一区二区精品秋霞影院| 欧美mv日韩mv| 制服丝袜av成人在线看| 欧美日韩不卡视频| 在线观看视频一区二区欧美日韩| 成人av在线资源| 国产电影一区二区三区| 国内成人免费视频| 美美哒免费高清在线观看视频一区二区| 亚洲精品免费电影| 一区二区三区日韩| 亚洲一区二区精品久久av| 一区二区三区四区蜜桃| 亚洲欧美日韩国产成人精品影院| 亚洲视频香蕉人妖| 亚洲精品乱码久久久久久日本蜜臀| 最新国产精品久久精品| 中文字幕视频一区| 亚洲欧洲日韩av| 中文字幕在线不卡| 亚洲女同女同女同女同女同69| 亚洲欧美日韩中文播放| 亚洲一区二区三区国产| 亚洲123区在线观看| 午夜精品视频在线观看| 日韩成人一级片| 美国毛片一区二区三区| 狠狠v欧美v日韩v亚洲ⅴ| 国产精品亚洲第一区在线暖暖韩国| 黄色小说综合网站| 国产v综合v亚洲欧| 色女孩综合影院| 欧美日韩视频在线一区二区| 51精品视频一区二区三区| 日韩欧美专区在线| 337p粉嫩大胆色噜噜噜噜亚洲 | 亚洲国产一区二区三区青草影视| 亚洲永久精品大片| 青青草91视频| 国产成人av电影在线| 色偷偷久久一区二区三区| 精品1区2区3区| 精品久久久久久久久久久院品网 | 91首页免费视频| 欧美伊人久久久久久久久影院 | 久久久久国产精品麻豆ai换脸 | 亚洲人成网站影音先锋播放| 一区二区三区四区蜜桃| 日韩福利电影在线观看| 国产成人精品亚洲777人妖| 日本久久一区二区| 欧美成人免费网站| 日韩美女啊v在线免费观看| 天堂久久一区二区三区| 国产激情视频一区二区三区欧美| 色综合中文字幕国产 | 中文文精品字幕一区二区| 亚洲精品成a人| 国产一区 二区| 欧美日韩二区三区| 国产亚洲一区二区三区四区| 亚洲成av人综合在线观看| 国产盗摄一区二区| 精品婷婷伊人一区三区三| 久久久.com| 五月婷婷久久丁香| 成人v精品蜜桃久久一区| 5月丁香婷婷综合| 国产精品久久久久aaaa| 青青草国产精品亚洲专区无| 91美女视频网站| 日韩视频一区二区| 亚洲精品伦理在线| 成人免费视频一区| 欧美大片在线观看| 亚洲chinese男男1069| 成人激情av网| 精品国产免费视频| 日韩高清在线观看| 欧美性猛交xxxxxxxx| 中文字幕久久午夜不卡| 久久国产精品99久久久久久老狼 | 成人污污视频在线观看| 日韩欧美www| 亚洲国产sm捆绑调教视频| 99久精品国产| 欧美—级在线免费片| 久久狠狠亚洲综合| 欧美精品一二三区| 亚洲成人激情自拍| 欧洲另类一二三四区| 综合亚洲深深色噜噜狠狠网站| 国产精品综合一区二区| 91精品在线一区二区| 亚洲一区免费视频| 色婷婷精品大视频在线蜜桃视频| 国产精品不卡一区| 国产成人精品免费看| 国产日产欧美精品一区二区三区| 久久99精品视频| 日韩三级中文字幕| 日本 国产 欧美色综合| 欧美精品日韩一区| 蜜臀精品久久久久久蜜臀| 777午夜精品免费视频| 亚洲国产综合91精品麻豆| 欧美日韩国产首页| 午夜精品视频一区| 欧美日韩国产综合视频在线观看| 亚洲成人激情av| 欧美精品第1页| 免费视频一区二区| 26uuu精品一区二区三区四区在线| 久久91精品国产91久久小草| 精品久久人人做人人爽| 国产91在线观看丝袜| 国产精品久久久久久久久晋中| 99热99精品| 一区二区三区在线视频免费| 欧美日韩五月天| 久久国产精品72免费观看| 久久久美女毛片| 国产69精品久久久久777| 1区2区3区精品视频| 91福利视频久久久久| 污片在线观看一区二区| 日韩午夜在线观看视频| 国产一区亚洲一区| 国产精品毛片a∨一区二区三区| 波多野结衣视频一区| 一区二区三区精品| 欧美一级黄色片| 国产精品影视天天线| 最新日韩av在线| 欧美另类高清zo欧美| 国产精品69毛片高清亚洲| 国产精品久久久久久户外露出| 在线观看日韩毛片|