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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? mempartlib.c

?? vxworks 5.5 kernel code
?? 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 */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美日韩视频在线观看| 欧美高清精品3d| 久久综合精品国产一区二区三区 | 国产在线看一区| 91精品啪在线观看国产60岁| 亚洲v精品v日韩v欧美v专区| 91黄色免费看| 亚洲一区二区三区四区在线观看| 91在线丨porny丨国产| ...xxx性欧美| 91麻豆国产自产在线观看| 中文字幕一区二区三区在线播放 | 日韩精品一二三| 欧美精品一二三| 亚洲电影一区二区三区| 欧美日韩一本到| 日韩av网站免费在线| 欧美一级高清大全免费观看| 天天爽夜夜爽夜夜爽精品视频| 欧美性色aⅴ视频一区日韩精品| 一区二区三区国产| 欧美丝袜丝交足nylons图片| 亚洲mv大片欧洲mv大片精品| 91精品国产色综合久久不卡蜜臀 | 亚洲精品欧美在线| 99久久99久久免费精品蜜臀| 国产欧美视频一区二区| 91在线观看成人| 图片区日韩欧美亚洲| 欧美精品黑人性xxxx| av一区二区三区在线| 综合久久国产九一剧情麻豆| 色噜噜狠狠色综合中国| 日韩精品免费视频人成| 久久综合视频网| 波多野结衣在线aⅴ中文字幕不卡| 国产精品成人免费在线| 欧美日韩小视频| 国产精品综合一区二区| 亚洲伦在线观看| 91麻豆精品国产综合久久久久久 | aa级大片欧美| 日本在线观看不卡视频| 国产日韩欧美精品电影三级在线 | 亚洲一区国产视频| 日韩一区二区三区电影| 高清国产一区二区| 亚洲超丰满肉感bbw| 精品国产亚洲一区二区三区在线观看| 成人午夜av影视| 丝袜美腿高跟呻吟高潮一区| 国产欧美一区二区三区在线看蜜臀| 欧洲av一区二区嗯嗯嗯啊| 久久99精品国产91久久来源| 亚洲乱码中文字幕综合| 精品国产免费视频| 欧美在线观看禁18| 国产传媒一区在线| 免费人成在线不卡| 亚洲免费观看高清完整版在线| 日韩一区二区电影| 欧美色手机在线观看| 日本道色综合久久| 国产99精品国产| 另类调教123区| 亚洲国产成人av| 中文字幕中文字幕一区二区| 精品国产乱码久久久久久老虎| 欧美伊人久久大香线蕉综合69 | 欧美老年两性高潮| 日本国产一区二区| 成人国产精品视频| 国产精品综合视频| 韩国av一区二区三区四区| 亚洲第一av色| 亚洲综合区在线| 亚洲欧洲制服丝袜| 国产精品大尺度| 中文字幕电影一区| 久久久精品2019中文字幕之3| 69精品人人人人| 91精品在线一区二区| 欧美视频一二三区| 在线观看国产91| 色综合中文字幕国产 | www.成人网.com| 国产丶欧美丶日本不卡视频| 麻豆精品在线视频| 狂野欧美性猛交blacked| 亚洲一区二区三区视频在线| 亚洲码国产岛国毛片在线| 最新中文字幕一区二区三区 | 日韩av中文字幕一区二区| 亚洲 欧美综合在线网络| 亚洲国产精品欧美一二99| 一二三四区精品视频| 一区二区在线免费观看| 亚洲免费视频中文字幕| 一区二区三区在线影院| 一区二区久久久久| 亚洲一区二区三区四区五区黄 | 99久久综合精品| 99久久99久久综合| 在线免费av一区| 欧美精品三级在线观看| 欧美一区二区三区电影| 日韩视频免费直播| 久久久综合网站| 欧美激情在线免费观看| 国产精品对白交换视频| 亚洲人成伊人成综合网小说| 亚洲黄色小视频| 亚洲va欧美va天堂v国产综合| 成人欧美一区二区三区黑人麻豆| 国产精品久久久久久久久免费丝袜 | 日本欧美一区二区三区| 久久爱另类一区二区小说| 国产精品系列在线播放| 成人免费观看视频| 日韩女优毛片在线| 久久精品无码一区二区三区| 国产精品第一页第二页第三页| 亚洲欧美一区二区不卡| 石原莉奈在线亚洲二区| 激情欧美一区二区三区在线观看| 日韩不卡一区二区| 国产成人综合在线观看| 91麻豆国产香蕉久久精品| 欧美精品国产精品| 国产日产欧美一区| 一区二区成人在线视频| 韩国v欧美v亚洲v日本v| 91色.com| 精品国产91久久久久久久妲己| 国产精品久久久久久妇女6080| 亚洲一区二区3| 国产一区不卡精品| 欧美日韩另类一区| 国产蜜臀av在线一区二区三区 | 亚洲色图欧美在线| 亚洲曰韩产成在线| 日韩电影网1区2区| 国产在线精品免费av| 欧美日韩日日夜夜| 国产精品全国免费观看高清| 午夜av一区二区三区| 成人99免费视频| 日韩欧美国产一区在线观看| 国产精品欧美久久久久无广告| 日韩1区2区日韩1区2区| 国产一区二区三区免费播放| 欧美三级电影精品| 欧美国产日韩一二三区| 奇米精品一区二区三区四区 | 亚洲美女精品一区| 国产精品亚洲а∨天堂免在线| 91麻豆产精品久久久久久| 欧美午夜理伦三级在线观看| 欧美成人精品高清在线播放| 国产欧美一区二区在线观看| 亚洲成av人综合在线观看| www.亚洲国产| 久久九九国产精品| 日本成人在线电影网| 成人av影院在线| 国产欧美日韩在线| 激情久久五月天| 日韩一级大片在线观看| 天天综合色天天综合| 91在线精品一区二区| 欧美激情自拍偷拍| 国产成人av影院| 久久精品日韩一区二区三区| 奇米四色…亚洲| 欧美乱妇23p| 亚洲国产中文字幕| 欧美午夜精品久久久| 亚洲精品一二三| 色综合欧美在线| 亚洲综合无码一区二区| 在线视频国产一区| 亚洲一区免费在线观看| 欧美中文字幕亚洲一区二区va在线 | 一本大道综合伊人精品热热 | 这里是久久伊人| 日本欧美一区二区三区乱码| 7777精品伊人久久久大香线蕉完整版| 一区二区三区精品视频在线| 色乱码一区二区三区88| 亚洲尤物在线视频观看| 91麻豆免费观看| 日韩成人午夜电影| 91精品国产一区二区三区香蕉| 五月激情综合婷婷| 欧美一区二区三区色| 看国产成人h片视频| 久久亚区不卡日本| 成人av网在线| 亚洲激情五月婷婷| 制服丝袜av成人在线看|