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

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

?? mempartlib.c

?? VxWorks操作系統內核源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* memPartLib.c - core memory partition manager *//* Copyright 1984-2002 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------02c,22may02,zl   use the ALIGNED() macro for alignment test (SPR#74247).02b,23apr02,gls  added check for overflow in memPartAlignedAlloc (SPR #27741)02a,04oct01,tam  fixed doc. of arch alignment01z,03mar00,zl   merged SH support into T201y,15mar99,c_c  Doc: Fixed alignment for MIPS (SPR #8883).01x,21feb99,jdi  doc: listed errnos.01w,17feb98,dvs  added instrumentation points (pr)01v,17dec97,yp   corrected documentation for memPartIsValid (SPR #8537)01u,07oct96,dgp  doc: change description of memPartXxx() (no partition		 deletion available)01t,19mar95,dvs  removed tron references.01s,19sep94,rhp  added stdlib.h to INCLUDE FILES list in doc (SPR#2285)01r,13sep93,jmm  fixed memPartAddToPool to check correct sizes of memory01q,24jun93,jmm  fixed memPartAddToPool to reject pool sizes that are too small01p,24jun93,jmm  fixed memPartAddToPool to round poolSize down to alignment                 boundry (spr 2185)01o,10feb93,jdi  deleted mention of "error" handling in doc for free();		 fixed spelling of stdlib.h.01n,05feb93,jdi  tweaked wording for 01m.01m,05feb93,smb  corrected return documentation for free and malloc01l,23jan93,jdi  documentation cleanup for 5.1.01k,13nov92,dnw  added include of smObjLib.h01j,20oct92,pme  added reference to shared memory manager documentation.01i,02oct92,jdi  documentation cleanup.01h,08sep92,jmm  changed memPartFree() to mark coalesced blocks as not free01g,23aug92,jcf  changed bzero to bfill.  removed taskOptionsGet.01f,29jul92,pme  added NULL function pointer check for smObj routines.01e,28jul92,jcf  changed default memory partition options.		 moved MEM_BLOCK_ERROR_SUSPEND_FLAG handling here.01d,19jul92,pme  added shared memory partition support.01c,19jul92,smb  added some ANSI documentation.01b,18jul92,smb  Changed errno.h to errnoLib.h.01a,01jul92,jcf  extracted from v4n memLib.c*//*DESCRIPTIONThis library provides core facilities for managing the allocation ofblocks of memory from ranges of memory called memory partitions.  Thelibrary was designed to provide a compact implementation; full-featuredfunctionality is available with memLib, which provides enhanced memorymanagement features built as an extension of memPartLib.  (For moreinformation about enhanced memory partition management options, see themanual entry for memLib.)  This library consists of two sets of routines.The first set, memPart...(), comprises a general facility for the creationand management of memory partitions, and for the allocation and deallocationof blocks from those partitions.  The second set provides a traditionalANSI-compatible malloc()/free() interface to the system memory partition.The system memory partition is created when the kernel is initialized bykernelInit(), which is called by the root task, usrRoot(), inusrConfig.c.  The ID of the system memory partition is stored in theglobal variable `memSysPartId'; its declaration is included in memLib.h.The allocation of memory, using malloc() in the typical case andmemPartAlloc() for a specific memory partition, is done with a first-fitalgorithm.  Adjacent blocks of memory are coalesced when they are freedwith memPartFree() and free().  There is also a routine provided for allocatingmemory aligned to a specified boundary from a specific memory partition,memPartAlignedAlloc().CAVEATSArchitectures have various alignment constraints.  To provide optimalperformance, malloc() returns a pointer to a buffer having the appropriatealignment for the architecture in use.  The portion of the allocatedbuffer reserved for system bookkeeping, known as the overhead, may varydepending on the architecture..ne 12.TScenter,tab(|);lf3 cf3 cf3a n n .Architecture | Boundary | Overhead_ ARM       |   4  |   8 COLDFIRE  |   4  |   8 I86       |   4  |   8 M68K      |   4  |   8 MCORE     |   8  |   8 MIPS      |  16  |  16 PPC *     | 8/16 | 8/16 SH        |   4  |   8 SIMNT     |   8  |   8 SIMSOLARIS|   8  |   8 SPARC     |   8  |   8.TE* On PowerPC, the boundary and overhead values are 16 bytes for system basedon the PPC604 CPU type (including ALTIVEC). For all other PowerPC CPU types(PPC403, PPC405, PPC440, PPC860, PPC603, etc...), the boundary and overhead are 8 bytes.INCLUDE FILES: memLib.h, stdlib.hSEE ALSO: memLib, 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 requestedby the user.  Each block is prefaced by a header which contains the sizeand status of that block and a pointer to the previous block.  The pointerreturned to the user points just past this header.  Likewise when a blockis freed, the header is found just in front of the block pointer passed bythe 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 "errnoLib.h"#include "smObjLib.h"#include "private/memPartLibP.h"#include "private/eventP.h"/* forward static functions */LOCAL void	 memPartSemInit (PART_ID partId);LOCAL STATUS	 memPartDestroy (PART_ID partId);LOCAL BLOCK_HDR *memAlignedBlockSplit (PART_ID partId, BLOCK_HDR *pHdr, 				       unsigned nWords, unsigned minWords,				       unsigned alignment);/* local variables */LOCAL PARTITION memSysPartition;	/* system partition used by malloc */LOCAL OBJ_CLASS memPartClass;		/* memory partition object class */LOCAL BOOL	memPartLibInstalled;	/* TRUE if library has been installed */#ifdef WV_INSTRUMENTATIONLOCAL OBJ_CLASS memPartInstClass;	/* mem part instrumented object class */#endif/* global variables */FUNCPTR  smMemPartAddToPoolRtn	= NULL;FUNCPTR  smMemPartFreeRtn	= NULL;FUNCPTR  smMemPartAllocRtn	= NULL;CLASS_ID memPartClassId 	= &memPartClass;	/* partition class id */#ifdef WV_INSTRUMENTATIONCLASS_ID memPartInstClassId	= &memPartInstClass;    /* part inst class id */#endifPART_ID  memSysPartId		= &memSysPartition;	/* sys partition id */UINT	 memDefaultAlignment	= _ALLOC_ALIGN_SIZE;	/* default alignment */FUNCPTR  memPartBlockErrorRtn	= NULL;			/* block error method */FUNCPTR  memPartAllocErrorRtn	= NULL;			/* alloc error method */FUNCPTR  memPartSemInitRtn	= (FUNCPTR) memPartSemInit;unsigned memPartOptionsDefault	= MEM_BLOCK_ERROR_SUSPEND_FLAG |				  MEM_BLOCK_CHECK;/********************************************************************************* memPartLibInit - 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 memPartLibInit     (    char *pPool,        /* pointer to memory block */    unsigned poolSize   /* block size in bytes */    )    {    if ((!memPartLibInstalled) &&	(classInit (memPartClassId, sizeof (PARTITION),		    OFFSET (PARTITION, objCore), (FUNCPTR) memPartCreate,		    (FUNCPTR) memPartInit, (FUNCPTR) memPartDestroy) == OK))	{#ifdef WV_INSTRUMENTATION	/* Instrumented class for windview */	memPartClassId->initRtn = (FUNCPTR) memPartInstClassId;	classInstrument (memPartClassId, memPartInstClassId); #endif	memPartInit (&memSysPartition, pPool, poolSize);	memPartLibInstalled = TRUE;	}    return ((memPartLibInstalled) ? OK : ERROR);    }/********************************************************************************* memPartCreate - create a memory partition** This routine creates a new memory partition containing a specified* memory pool.  It returns a partition ID, which can then be passed to* other routines to manage the partition (i.e., to allocate and free* memory blocks in the partition).  Partitions can be created to manage* any number of separate memory pools.** NOTE* The descriptor for the new partition is allocated out of the system memory* partition (i.e., with malloc()).** RETURNS:* The partition ID, or NULL if there is insufficient memory in the system* memory partition for a new partition descriptor.** SEE ALSO: smMemLib*/PART_ID memPartCreate     (    char *pPool,        /* pointer to memory area */    unsigned poolSize   /* size in bytes */    )    {    FAST PART_ID pPart;    /* allocate a partition structure from the system memory partition */    pPart = (PART_ID) objAlloc (memPartClassId);    if (pPart != NULL)	memPartInit (pPart, pPool, poolSize);#ifdef WV_INSTRUMENTATION    EVT_OBJ_2 (OBJ, pPart, memPartClassId, EVENT_MEMPARTCREATE, pPart, poolSize);#endif    return (pPart);    }/********************************************************************************* memPartInit - initialize a memory partition** This routine initializes a partition free list, seeding it with the* memory block passed as an argument.  It must be called exactly once* for each memory partition created.** SEE ALSO: memPartCreate()** NOMANUAL*/void memPartInit     (    FAST PART_ID partId,        /* partition to initialize */    char *pPool,                /* pointer to memory block */    unsigned poolSize           /* block size in bytes */    )    {    /* initialize partition descriptor */    bfill ((char *) partId, sizeof (*partId), 0);    partId->options	  = memPartOptionsDefault;    partId->minBlockWords = sizeof (FREE_BLOCK) >> 1;    /* initialize partition semaphore with a virtual function so semaphore     * type is selectable.  By default memPartLibInit() will utilize binary     * semaphores while memInit() will utilize mutual exclusion semaphores     * with the options stored in _mutexOptionsMemLib.     */    (* memPartSemInitRtn) (partId);    dllInit (&partId->freeList);			/* init. free list */#ifdef WV_INSTRUMENTATION    if (wvObjIsEnabled)    {    /* windview - connect object class event logging routine */    objCoreInit (&partId->objCore, memPartInstClassId);     }    else#endif    objCoreInit (&partId->objCore, memPartClassId);	/* initialize core */    (void) memPartAddToPool (partId, pPool, poolSize);    }/********************************************************************************* memPartDestroy - destroy a partition and optionally free associated memory** This routine is not currently supported.  Partitions may not be destroyed.** ARGSUSED*/LOCAL STATUS memPartDestroy     (    PART_ID partId      /* partition to initialize */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美视频完全免费看| 成人h动漫精品| 91精品国产91久久久久久一区二区| 亚洲欧美国产高清| 在线观看不卡一区| 天使萌一区二区三区免费观看| 欧美精品日韩精品| 精品亚洲成a人在线观看| 久久精品网站免费观看| 99在线精品免费| 亚洲一区二区三区四区五区黄 | 一个色在线综合| 欧美午夜精品久久久久久超碰| 午夜伦欧美伦电影理论片| 日韩欧美激情一区| 国产麻豆精品在线观看| 亚洲天堂精品在线观看| 欧美理论在线播放| 国产一区中文字幕| 亚洲精品成人在线| 日韩三级视频在线观看| 国产成人精品免费视频网站| 亚洲私人影院在线观看| 日韩一区二区精品葵司在线| 丁香天五香天堂综合| 亚洲一区二区三区中文字幕在线 | 色婷婷综合久久久| 日韩福利视频导航| 国产精品欧美久久久久无广告| 色一区在线观看| 久久精品久久久精品美女| 国产精品国产三级国产a| 538在线一区二区精品国产| 国产91精品在线观看| 天涯成人国产亚洲精品一区av| 国产性天天综合网| 欧美精品久久天天躁| 粉嫩高潮美女一区二区三区| 亚洲va在线va天堂| 国产日产亚洲精品系列| 3atv一区二区三区| 北条麻妃一区二区三区| 精品系列免费在线观看| 亚洲第一会所有码转帖| 中文字幕国产精品一区二区| 日韩亚洲国产中文字幕欧美| 色综合久久88色综合天天| 国产精品一区二区不卡| 日日摸夜夜添夜夜添亚洲女人| 中文字幕av资源一区| 精品久久久久久久久久久院品网 | 国内外成人在线| 亚洲bdsm女犯bdsm网站| 国产精品国产三级国产普通话蜜臀 | 亚洲视频图片小说| 久久精品欧美日韩精品| 日韩欧美成人一区| 欧美三级电影在线看| 91啦中文在线观看| 成人午夜精品在线| 精品一区二区三区视频在线观看| 亚洲一区中文日韩| 亚洲男帅同性gay1069| 中文字幕免费不卡在线| 久久久久久9999| 欧美电视剧免费观看| 欧美日本在线看| 在线观看不卡视频| 色欧美乱欧美15图片| 99免费精品视频| 97成人超碰视| 99久久精品情趣| 不卡一区二区在线| 国产91对白在线观看九色| 国产一区二区主播在线| 激情另类小说区图片区视频区| 捆绑调教一区二区三区| 蜜臀av一区二区| 精品在线观看视频| 国产美女精品在线| 国产成人精品免费网站| 成人午夜在线播放| 成人在线视频一区二区| 成人av网站在线观看免费| 懂色av一区二区三区蜜臀 | 久久电影网站中文字幕| 久久黄色级2电影| 久草中文综合在线| 国产精品一区免费在线观看| 国产在线麻豆精品观看| 国产乱淫av一区二区三区| 成人综合在线网站| 色综合欧美在线视频区| 欧美三级韩国三级日本一级| 欧美精品乱码久久久久久按摩| 日韩一区二区三区免费观看| 久久综合色播五月| 中文字幕在线播放不卡一区| 亚洲制服欧美中文字幕中文字幕| 亚洲国产精品一区二区尤物区| 青青草原综合久久大伊人精品| 日韩国产高清在线| 国模少妇一区二区三区| av一区二区三区| 欧美日韩国产高清一区| 欧美本精品男人aⅴ天堂| 国产精品污www在线观看| 一区二区三区四区在线播放| 日产欧产美韩系列久久99| 国产精品一区二区三区99| 色一情一乱一乱一91av| 日韩精品最新网址| 亚洲欧美精品午睡沙发| 婷婷国产v国产偷v亚洲高清| 国产伦精品一区二区三区在线观看| 99国内精品久久| 欧美一区二区日韩一区二区| 国产区在线观看成人精品 | 久久精品国产精品亚洲红杏| 成人小视频在线观看| 欧美久久久久久久久久| 欧美国产激情一区二区三区蜜月| 一区二区三区中文字幕电影 | 日日夜夜精品免费视频| 国产91在线观看| 欧美一区三区二区| 日韩理论片中文av| 老司机午夜精品| 在线视频一区二区三区| 久久精品人人做人人爽人人| 亚洲成av人片一区二区梦乃| 懂色一区二区三区免费观看| 日韩一区二区三区观看| 亚洲女子a中天字幕| 国产一区二区三区免费播放| 欧美视频一区在线观看| 国产精品青草综合久久久久99| 免费成人美女在线观看.| 一本大道久久a久久精品综合| 久久九九全国免费| 欧美aaa在线| 在线看日本不卡| 中文无字幕一区二区三区 | 制服丝袜av成人在线看| 亚洲欧洲精品成人久久奇米网| 久久激情五月激情| 欧美久久久久中文字幕| 一区二区成人在线| 成人久久视频在线观看| 久久夜色精品国产噜噜av| 日韩激情在线观看| 欧美特级限制片免费在线观看| 国产精品天干天干在线综合| 精久久久久久久久久久| 日韩一区二区免费电影| 首页欧美精品中文字幕| 欧美日韩一区二区在线观看| 亚洲欧美日韩久久| 91网站最新网址| 国产精品久久看| 成人黄色av网站在线| 欧美国产1区2区| 国产精品亚洲成人| 国产色产综合色产在线视频| 国产在线精品一区二区不卡了 | 日本在线观看不卡视频| 欧美日韩久久一区| 午夜精品久久久久久| 欧美喷水一区二区| 日韩国产精品久久久| 日韩视频在线你懂得| 美脚の诱脚舐め脚责91| 欧美成人三级电影在线| 国产一区二区三区免费播放| 久久精品夜色噜噜亚洲aⅴ| 国产露脸91国语对白| 国产色综合久久| voyeur盗摄精品| 亚洲精品视频免费看| 欧美亚一区二区| 天天做天天摸天天爽国产一区 | 欧美在线观看视频在线| 亚洲香肠在线观看| 91精品国产综合久久香蕉的特点| 日本亚洲一区二区| 欧美精品一区二区三区在线播放| 国产另类ts人妖一区二区| 一区精品在线播放| 欧美天天综合网| 精品影院一区二区久久久| 日本一区二区三区视频视频| 99久久国产综合精品麻豆| 亚洲国产精品久久人人爱蜜臀| 欧美美女直播网站| 国产美女精品在线| 亚洲久草在线视频| 日韩三级在线观看| 成人av免费在线播放| 亚洲18影院在线观看| 久久综合五月天婷婷伊人|