亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
av在线不卡网| 男女男精品视频| 久久久亚洲国产美女国产盗摄| 91国偷自产一区二区使用方法| 高清国产午夜精品久久久久久| 看电视剧不卡顿的网站| 青青草国产精品亚洲专区无| 亚洲高清免费在线| 亚洲成av人片一区二区梦乃 | 午夜私人影院久久久久| 亚洲午夜在线电影| 亚洲一区二区精品久久av| 亚洲麻豆国产自偷在线| 亚洲欧洲中文日韩久久av乱码| 亚洲免费毛片网站| 亚洲va韩国va欧美va精品| 视频一区视频二区中文字幕| 美脚の诱脚舐め脚责91| 国产成人精品一区二区三区四区| 国产精品一区二区三区四区 | 亚洲激情五月婷婷| 亚洲影视在线观看| 青娱乐精品视频| 精品亚洲免费视频| av中文字幕在线不卡| 色婷婷av一区二区三区之一色屋| 在线观看日韩av先锋影音电影院| 国产色综合一区| 宅男噜噜噜66一区二区66| 午夜久久久久久电影| 成人午夜免费av| 91精品国产一区二区三区 | 欧美日韩午夜影院| 亚洲精品乱码久久久久久日本蜜臀| 国产精品一级在线| 久久久国产综合精品女国产盗摄| 精品一区二区三区免费| 久久先锋资源网| 国产一区二区三区香蕉| 久久精品视频免费观看| 国产高清亚洲一区| 国产精品美女久久久久久| 成人免费毛片嘿嘿连载视频| 中文字幕欧美激情一区| 99热这里都是精品| 亚洲综合丁香婷婷六月香| 91论坛在线播放| 亚洲综合视频在线观看| 7799精品视频| 久久精品国产亚洲一区二区三区| 亚洲精品在线三区| 国产成+人+日韩+欧美+亚洲| 国产精品久久久久久久裸模| 91啪九色porn原创视频在线观看| 一区二区三区在线视频观看| 欧美精品乱人伦久久久久久| 免费日本视频一区| 久久久av毛片精品| 日本福利一区二区| 亚洲成人免费电影| www亚洲一区| 99国产精品久久久久久久久久久| 一区二区免费在线播放| 欧美精品自拍偷拍动漫精品| 激情综合亚洲精品| 中文字幕一区二区三区色视频| 欧美日韩在线直播| 精品影院一区二区久久久| 国产精品久久久久久亚洲伦| 欧美精品18+| 国产精品一区二区x88av| 亚洲色图一区二区| 欧美一级搡bbbb搡bbbb| 成人午夜私人影院| 亚洲va欧美va天堂v国产综合| 日韩一区二区三区电影在线观看| 国产99久久久国产精品潘金| 亚洲综合成人在线视频| 2023国产一二三区日本精品2022| 91同城在线观看| 精品一区二区三区免费观看| 亚洲精品成人a在线观看| 精品美女在线观看| 欧美亚洲丝袜传媒另类| 国产ts人妖一区二区| 亚洲不卡在线观看| 国产精品美女久久久久久久久 | 亚洲国产三级在线| 久久久久久毛片| 91精品婷婷国产综合久久竹菊| av电影在线不卡| 久久99精品国产| 亚洲第一激情av| 亚洲私人黄色宅男| 久久精品免费在线观看| 宅男在线国产精品| 精品视频在线免费观看| 成人美女视频在线观看18| 蜜桃av一区二区| 亚洲国产日韩a在线播放| 欧美国产激情二区三区| 日韩精品在线一区| 91精品国产综合久久久久久漫画 | 亚洲综合色在线| 成人免费在线播放视频| 欧美韩国一区二区| 精品999久久久| 日韩精品一区二区在线观看| 欧美日韩综合在线| 欧美亚洲禁片免费| 在线观看91视频| 91麻豆国产自产在线观看| 成人高清免费观看| 国产.欧美.日韩| 国产精品2024| 国产乱码精品一区二区三区忘忧草 | 欧美v亚洲v综合ⅴ国产v| 欧美精品色综合| 欧美日韩第一区日日骚| 欧美日韩免费观看一区二区三区| 不卡一区在线观看| 成人av在线看| 成人精品高清在线| 成人动漫精品一区二区| 99精品国产99久久久久久白柏| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 丝袜美腿成人在线| 美美哒免费高清在线观看视频一区二区| 日韩在线观看一区二区| 六月丁香综合在线视频| 国产成人精品一区二区三区网站观看| 丰满岳乱妇一区二区三区| 97国产精品videossex| 91国偷自产一区二区三区成为亚洲经典| 一本久久综合亚洲鲁鲁五月天| 91精彩视频在线| 在线综合亚洲欧美在线视频| 2024国产精品| 综合色中文字幕| 婷婷丁香久久五月婷婷| 免费欧美高清视频| 国产伦精品一区二区三区免费迷 | 视频一区欧美日韩| 秋霞av亚洲一区二区三| 免费成人小视频| 日韩国产欧美三级| 国产一区二区不卡老阿姨| 国产原创一区二区| 国产91精品露脸国语对白| 成人免费毛片嘿嘿连载视频| 精品一区二区三区久久久| 国产精品18久久久久久vr| 成人av免费在线| 91浏览器打开| 欧美日韩高清一区二区不卡| 国产午夜精品久久久久久免费视| 国产拍揄自揄精品视频麻豆| 亚洲特黄一级片| 日韩av在线播放中文字幕| 不卡免费追剧大全电视剧网站| 色噜噜久久综合| 91精选在线观看| 久久久久国色av免费看影院| 久久精品视频在线看| 亚洲欧美在线高清| 午夜精品久久久久久久 | 久久―日本道色综合久久| 亚洲日本在线天堂| 午夜精品久久久久久久久| 国产精品 日产精品 欧美精品| 91亚洲国产成人精品一区二三| 色先锋资源久久综合| 久久综合一区二区| 一级日本不卡的影视| 精品在线播放午夜| 99这里只有精品| 久久蜜桃av一区精品变态类天堂 | 在线看不卡av| 精品少妇一区二区三区在线播放 | 在线观看日产精品| 中文字幕欧美激情| 日韩—二三区免费观看av| 波多野结衣一区二区三区 | 一区二区三区在线观看动漫| 精品一区二区综合| 99精品热视频| 欧美日韩亚洲综合一区二区三区| 精品系列免费在线观看| 精品国产一区二区三区忘忧草 | 日韩成人一级大片| 91免费观看视频| 久久综合给合久久狠狠狠97色69| 一区二区三区四区不卡在线 | 亚洲一区二区三区四区五区黄| 激情综合色综合久久| 欧美性猛交xxxxxx富婆| 亚洲精品成人少妇| 成人97人人超碰人人99| 久久综合成人精品亚洲另类欧美 | 91首页免费视频|