亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产综合久久久久久鬼色| 亚洲一区中文在线| 亚洲欧洲精品一区二区三区 | 欧美最新大片在线看 | 欧美这里有精品| 精品国产不卡一区二区三区| 国产精品电影一区二区| 天天综合天天做天天综合| 成人爱爱电影网址| 日韩欧美一区二区免费| 亚洲女厕所小便bbb| 国产精品一区二区果冻传媒| 欧美日韩dvd在线观看| 亚洲图片你懂的| 国产精品自拍在线| 日韩欧美专区在线| 午夜精品成人在线| 色婷婷av久久久久久久| 国产精品天干天干在线综合| 免费精品视频最新在线| 欧美日韩成人一区| 亚洲一线二线三线视频| 色婷婷亚洲综合| 国产精品久久久久久久久动漫 | 日本 国产 欧美色综合| 欧洲视频一区二区| 亚洲免费观看高清| 一本一本大道香蕉久在线精品 | 久久久久久久久久久久久久久99| 91黄色小视频| 日韩欧美视频一区| 亚洲午夜私人影院| 国产成人无遮挡在线视频| 久久综合久久鬼色| 波多野结衣的一区二区三区| 久久久91精品国产一区二区精品| 日韩电影一区二区三区四区| 国产精品女主播av| 国产精品国产三级国产三级人妇| 中文字幕国产一区| 亚洲国产日韩精品| 91亚洲精品久久久蜜桃| 国产欧美精品一区二区三区四区 | 成人小视频在线| 日韩视频一区二区在线观看| 视频一区欧美精品| 久久精品亚洲乱码伦伦中文 | 92精品国产成人观看免费 | 天天综合色天天综合色h| 热久久免费视频| 成人午夜视频在线观看| 欧美一区二区福利在线| 国产精品欧美久久久久一区二区| 亚洲精品乱码久久久久久日本蜜臀| 国产精品资源在线观看| 91亚洲男人天堂| 亚洲女人小视频在线观看| 麻豆精品一区二区| 精品视频123区在线观看| 亚洲国产一区二区视频| 色哟哟一区二区| 中文字幕欧美日韩一区| 亚洲免费电影在线| 欧美亚洲动漫另类| 亚洲午夜一区二区| 日韩欧美在线综合网| 日韩黄色免费电影| 欧美日本免费一区二区三区| 国产剧情一区在线| 亚洲美女视频在线观看| 亚洲综合一区二区精品导航| 午夜一区二区三区在线观看| 午夜婷婷国产麻豆精品| 精品视频在线免费看| 亚洲欧洲日韩在线| 欧美亚洲尤物久久| 一区二区在线观看免费| 久久99国产乱子伦精品免费| 麻豆国产精品一区二区三区| 国产高清不卡一区| 制服丝袜日韩国产| 国产综合色精品一区二区三区| 欧美高清www午色夜在线视频| 奇米精品一区二区三区在线观看一| 欧美三级日韩三级国产三级| 亚洲自拍偷拍欧美| 1024成人网| 日本一区二区三区dvd视频在线| 精品久久久久久久久久久久包黑料| 在线观看亚洲成人| 欧美日韩一本到| 91精品国产综合久久久久久久久久| 成人美女视频在线观看| 色偷偷一区二区三区| 91亚洲精品久久久蜜桃| 欧美日韩美少妇 | 蜜臀av一区二区在线免费观看| 精品欧美一区二区久久| 国产福利一区在线观看| 中文欧美字幕免费| 91精品国产麻豆国产自产在线| 国产中文字幕精品| 日本不卡123| 日韩国产精品久久久| 亚洲视频在线观看三级| 日韩西西人体444www| 91免费观看视频| 成人av电影观看| 91丨九色丨尤物| 成人毛片视频在线观看| 日韩av高清在线观看| 久久亚洲精华国产精华液| 麻豆精品国产传媒mv男同| 中文字幕亚洲精品在线观看| 精品少妇一区二区三区免费观看| 中文字幕高清不卡| 亚洲一区中文在线| 777欧美精品| 99国产精品99久久久久久| 一区二区三区四区不卡视频| 在线一区二区三区四区五区 | 久久久99免费| 中文字幕在线不卡视频| 亚洲欧美综合另类在线卡通| 欧美一级夜夜爽| 中文字幕在线一区免费| 久久不见久久见中文字幕免费| 成人的网站免费观看| 精品盗摄一区二区三区| 久久激五月天综合精品| 69久久夜色精品国产69蝌蚪网| 一区二区三区资源| 色综合天天综合网国产成人综合天 | 国产精品嫩草久久久久| 日韩精品色哟哟| 在线国产亚洲欧美| 欧美经典三级视频一区二区三区| 国产精品成人免费在线| 亚洲va韩国va欧美va| 国产高清不卡二三区| 在线观看免费视频综合| 精品日产卡一卡二卡麻豆| **性色生活片久久毛片| 国产综合一区二区| 91精品国产欧美一区二区成人| 久久久影院官网| 日本不卡一区二区三区| 欧美日本国产视频| 亚洲精品videosex极品| 国产成人免费在线| 欧美精品一区二区三区蜜臀| 中文字幕一区av| 久久精品国产秦先生| 美国毛片一区二区| 激情综合网最新| 91丨porny丨首页| 欧美精品色综合| 久久久久久一二三区| 亚洲精品日韩一| 久久国产精品露脸对白| 99国产欧美另类久久久精品| 欧美久久一二区| 中文无字幕一区二区三区| 日韩国产精品久久| 97久久超碰国产精品| 欧美一区二区女人| 亚洲欧洲日韩在线| 国产一区二区电影| 欧美日韩亚洲另类| 中文字幕乱码亚洲精品一区 | 欧美日韩一级二级| 国产日韩av一区| 日韩有码一区二区三区| 成人妖精视频yjsp地址| 日韩一区二区精品葵司在线| 亚洲精品国产无天堂网2021 | 欧美亚洲高清一区二区三区不卡| 久久蜜桃av一区精品变态类天堂| 亚洲猫色日本管| 丰满少妇久久久久久久| 日韩片之四级片| 午夜不卡av在线| av网站免费线看精品| 久久久久国产精品麻豆| 蜜桃精品视频在线观看| 欧美日韩激情一区二区| 亚洲同性gay激情无套| 国产999精品久久久久久绿帽| 日韩视频免费观看高清在线视频| 一区二区三区不卡在线观看| 韩国精品一区二区| 三级在线观看一区二区| 日本一不卡视频| 国内精品伊人久久久久影院对白| 91精品国产色综合久久ai换脸| 免费观看久久久4p| 久久久精品日韩欧美| 91色综合久久久久婷婷| 成人一区二区三区中文字幕| 捆绑变态av一区二区三区|