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

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

?? mem3.c

?? 嵌入式數據系統軟件!
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*** 2007 October 14**** The author disclaims copyright to this source code.  In place of** a legal notice, here is a blessing:****    May you do good and not evil.**    May you find forgiveness for yourself and forgive others.**    May you share freely, never taking more than you give.***************************************************************************** This file contains the C functions that implement a memory** allocation subsystem for use by SQLite. **** This version of the memory allocation subsystem omits all** use of malloc().  All dynamically allocatable memory is** contained in a static array, mem.aPool[].  The size of this** fixed memory pool is SQLITE_MEMORY_SIZE bytes.**** This version of the memory allocation subsystem is used if** and only if SQLITE_MEMORY_SIZE is defined.**** $Id: mem3.c,v 1.7 2007/11/29 18:36:49 drh Exp $*//*** This version of the memory allocator is used only when ** SQLITE_MEMORY_SIZE is defined.*/#if defined(SQLITE_MEMORY_SIZE)#include "sqliteInt.h"#ifdef SQLITE_MEMDEBUG# error  cannot define both SQLITE_MEMDEBUG and SQLITE_MEMORY_SIZE#endif/*** Maximum size (in Mem3Blocks) of a "small" chunk.*/#define MX_SMALL 10/*** Number of freelist hash slots*/#define N_HASH  61/*** A memory allocation (also called a "chunk") consists of two or ** more blocks where each block is 8 bytes.  The first 8 bytes are ** a header that is not returned to the user.**** A chunk is two or more blocks that is either checked out or** free.  The first block has format u.hdr.  u.hdr.size is the** size of the allocation in blocks if the allocation is free.** If the allocation is checked out, u.hdr.size is the negative** of the size.  Similarly, u.hdr.prevSize is the size of the** immediately previous allocation.**** We often identify a chunk by its index in mem.aPool[].  When** this is done, the chunk index refers to the second block of** the chunk.  In this way, the first chunk has an index of 1.** A chunk index of 0 means "no such chunk" and is the equivalent** of a NULL pointer.**** The second block of free chunks is of the form u.list.  The** two fields form a double-linked list of chunks of related sizes.** Pointers to the head of the list are stored in mem.aiSmall[] ** for smaller chunks and mem.aiHash[] for larger chunks.**** The second block of a chunk is user data if the chunk is checked ** out.*/typedef struct Mem3Block Mem3Block;struct Mem3Block {  union {    struct {      int prevSize;   /* Size of previous chunk in Mem3Block elements */      int size;       /* Size of current chunk in Mem3Block elements */    } hdr;    struct {      int next;       /* Index in mem.aPool[] of next free chunk */      int prev;       /* Index in mem.aPool[] of previous free chunk */    } list;  } u;};/*** All of the static variables used by this module are collected** into a single structure named "mem".  This is to keep the** static variables organized and to reduce namespace pollution** when this module is combined with other in the amalgamation.*/static struct {  /*  ** True if we are evaluating an out-of-memory callback.  */  int alarmBusy;    /*  ** Mutex to control access to the memory allocation subsystem.  */  sqlite3_mutex *mutex;    /*  ** The minimum amount of free space that we have seen.  */  int mnMaster;  /*  ** iMaster is the index of the master chunk.  Most new allocations  ** occur off of this chunk.  szMaster is the size (in Mem3Blocks)  ** of the current master.  iMaster is 0 if there is not master chunk.  ** The master chunk is not in either the aiHash[] or aiSmall[].  */  int iMaster;  int szMaster;  /*  ** Array of lists of free blocks according to the block size   ** for smaller chunks, or a hash on the block size for larger  ** chunks.  */  int aiSmall[MX_SMALL-1];   /* For sizes 2 through MX_SMALL, inclusive */  int aiHash[N_HASH];        /* For sizes MX_SMALL+1 and larger */  /*  ** Memory available for allocation  */  Mem3Block aPool[SQLITE_MEMORY_SIZE/sizeof(Mem3Block)+2];} mem;/*** Unlink the chunk at mem.aPool[i] from list it is currently** on.  *pRoot is the list that i is a member of.*/static void memsys3UnlinkFromList(int i, int *pRoot){  int next = mem.aPool[i].u.list.next;  int prev = mem.aPool[i].u.list.prev;  assert( sqlite3_mutex_held(mem.mutex) );  if( prev==0 ){    *pRoot = next;  }else{    mem.aPool[prev].u.list.next = next;  }  if( next ){    mem.aPool[next].u.list.prev = prev;  }  mem.aPool[i].u.list.next = 0;  mem.aPool[i].u.list.prev = 0;}/*** Unlink the chunk at index i from ** whatever list is currently a member of.*/static void memsys3Unlink(int i){  int size, hash;  assert( sqlite3_mutex_held(mem.mutex) );  size = mem.aPool[i-1].u.hdr.size;  assert( size==mem.aPool[i+size-1].u.hdr.prevSize );  assert( size>=2 );  if( size <= MX_SMALL ){    memsys3UnlinkFromList(i, &mem.aiSmall[size-2]);  }else{    hash = size % N_HASH;    memsys3UnlinkFromList(i, &mem.aiHash[hash]);  }}/*** Link the chunk at mem.aPool[i] so that is on the list rooted** at *pRoot.*/static void memsys3LinkIntoList(int i, int *pRoot){  assert( sqlite3_mutex_held(mem.mutex) );  mem.aPool[i].u.list.next = *pRoot;  mem.aPool[i].u.list.prev = 0;  if( *pRoot ){    mem.aPool[*pRoot].u.list.prev = i;  }  *pRoot = i;}/*** Link the chunk at index i into either the appropriate** small chunk list, or into the large chunk hash table.*/static void memsys3Link(int i){  int size, hash;  assert( sqlite3_mutex_held(mem.mutex) );  size = mem.aPool[i-1].u.hdr.size;  assert( size==mem.aPool[i+size-1].u.hdr.prevSize );  assert( size>=2 );  if( size <= MX_SMALL ){    memsys3LinkIntoList(i, &mem.aiSmall[size-2]);  }else{    hash = size % N_HASH;    memsys3LinkIntoList(i, &mem.aiHash[hash]);  }}/*** Enter the mutex mem.mutex. Allocate it if it is not already allocated.**** Also:  Initialize the memory allocation subsystem the first time** this routine is called.*/static void memsys3Enter(void){  if( mem.mutex==0 ){    mem.mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_MEM);    mem.aPool[0].u.hdr.size = SQLITE_MEMORY_SIZE/8;    mem.aPool[SQLITE_MEMORY_SIZE/8].u.hdr.prevSize = SQLITE_MEMORY_SIZE/8;    mem.iMaster = 1;    mem.szMaster = SQLITE_MEMORY_SIZE/8;    mem.mnMaster = mem.szMaster;  }  sqlite3_mutex_enter(mem.mutex);}/*** Return the amount of memory currently checked out.*/sqlite3_int64 sqlite3_memory_used(void){  sqlite3_int64 n;  memsys3Enter();  n = SQLITE_MEMORY_SIZE - mem.szMaster*8;  sqlite3_mutex_leave(mem.mutex);    return n;}/*** Return the maximum amount of memory that has ever been** checked out since either the beginning of this process** or since the most recent reset.*/sqlite3_int64 sqlite3_memory_highwater(int resetFlag){  sqlite3_int64 n;  memsys3Enter();  n = SQLITE_MEMORY_SIZE - mem.mnMaster*8;  if( resetFlag ){    mem.mnMaster = mem.szMaster;  }  sqlite3_mutex_leave(mem.mutex);    return n;}/*** Change the alarm callback.**** This is a no-op for the static memory allocator.  The purpose** of the memory alarm is to support sqlite3_soft_heap_limit().** But with this memory allocator, the soft_heap_limit is really** a hard limit that is fixed at SQLITE_MEMORY_SIZE.*/int sqlite3_memory_alarm(  void(*xCallback)(void *pArg, sqlite3_int64 used,int N),  void *pArg,  sqlite3_int64 iThreshold){  return SQLITE_OK;}/*** Called when we are unable to satisfy an allocation of nBytes.*/static void memsys3OutOfMemory(int nByte){  if( !mem.alarmBusy ){    mem.alarmBusy = 1;    assert( sqlite3_mutex_held(mem.mutex) );    sqlite3_mutex_leave(mem.mutex);    sqlite3_release_memory(nByte);    sqlite3_mutex_enter(mem.mutex);    mem.alarmBusy = 0;  }}/*** Return the size of an outstanding allocation, in bytes.  The** size returned omits the 8-byte header overhead.  This only** works for chunks that are currently checked out.*/static int memsys3Size(void *p){  Mem3Block *pBlock = (Mem3Block*)p;  assert( pBlock[-1].u.hdr.size<0 );  return (-1-pBlock[-1].u.hdr.size)*8;}/*** Chunk i is a free chunk that has been unlinked.  Adjust its ** size parameters for check-out and return a pointer to the ** user portion of the chunk.*/static void *memsys3Checkout(int i, int nBlock){  assert( sqlite3_mutex_held(mem.mutex) );  assert( mem.aPool[i-1].u.hdr.size==nBlock );  assert( mem.aPool[i+nBlock-1].u.hdr.prevSize==nBlock );  mem.aPool[i-1].u.hdr.size = -nBlock;  mem.aPool[i+nBlock-1].u.hdr.prevSize = -nBlock;  return &mem.aPool[i];}/*** Carve a piece off of the end of the mem.iMaster free chunk.** Return a pointer to the new allocation.  Or, if the master chunk** is not large enough, return 0.*/static void *memsys3FromMaster(int nBlock){  assert( sqlite3_mutex_held(mem.mutex) );  assert( mem.szMaster>=nBlock );  if( nBlock>=mem.szMaster-1 ){    /* Use the entire master */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品欧美经典| 91在线视频观看| 国产欧美一区二区三区在线老狼 | 亚洲日本乱码在线观看| 天天做天天摸天天爽国产一区| 国产麻豆成人传媒免费观看| 91精品91久久久中77777| 久久人人97超碰com| 日本不卡123| 91福利资源站| 椎名由奈av一区二区三区| 国产麻豆视频一区| 精品三级在线观看| 午夜天堂影视香蕉久久| 色菇凉天天综合网| 亚洲视频小说图片| 丰满亚洲少妇av| 久久免费国产精品| 伦理电影国产精品| 午夜伦欧美伦电影理论片| 亚洲一区二区三区免费视频| 99麻豆久久久国产精品免费优播| 成人性生交大片免费看在线播放| 欧美日韩国产经典色站一区二区三区| 国产精品每日更新在线播放网址| 蜜臀国产一区二区三区在线播放 | 亚洲va天堂va国产va久| 91在线一区二区| 欧美电影免费观看高清完整版在线| 久久精品噜噜噜成人88aⅴ| 欧美性猛片aaaaaaa做受| 亚洲欧美欧美一区二区三区| 波多野结衣一区二区三区| 欧美国产精品一区二区三区| 国产一区二区久久| 久久久久久久久久久久久夜| 国产麻豆成人传媒免费观看| 综合在线观看色| 欧美videos中文字幕| 一本到三区不卡视频| av成人免费在线| 欧美午夜精品免费| 久久噜噜亚洲综合| 国产精品1区2区3区| 午夜精品影院在线观看| 中文字幕中文字幕一区二区| 国产精品毛片久久久久久| 国产尤物一区二区| 国产精品久久久久久久第一福利| 成人av网站免费| 亚洲乱码一区二区三区在线观看| 欧美写真视频网站| 久久爱www久久做| 国产农村妇女精品| 色噜噜狠狠色综合欧洲selulu| 精品女同一区二区| 欧美激情综合网| 美女脱光内衣内裤视频久久网站| 久久久国产一区二区三区四区小说| 国产91对白在线观看九色| 国产精品美女久久久久久2018| 一本到不卡免费一区二区| 日本v片在线高清不卡在线观看| 国产亚洲一二三区| 在线一区二区三区做爰视频网站| 日韩二区三区在线观看| 国产欧美一区二区三区在线看蜜臀| 色综合天天视频在线观看| 蜜桃视频一区二区| 亚洲女厕所小便bbb| 欧美电影免费观看高清完整版| 东方欧美亚洲色图在线| 亚洲chinese男男1069| 国产区在线观看成人精品| 日本电影欧美片| 国产黑丝在线一区二区三区| 亚洲综合无码一区二区| 国产欧美一区二区三区网站| 欧美猛男超大videosgay| 懂色av中文一区二区三区| 日韩国产欧美在线视频| 亚洲色图欧洲色图| 久久先锋资源网| 精品国产污污免费网站入口 | 国产精品一卡二卡| 亚洲自拍偷拍综合| 中文字幕欧美三区| 欧美大胆人体bbbb| 欧美日韩视频在线观看一区二区三区| 国产黄色成人av| 久久精品国产精品亚洲精品| 一区二区免费看| 欧美国产日韩亚洲一区| 日韩一区国产二区欧美三区| 色婷婷久久久久swag精品| 精品一区二区三区免费毛片爱 | 国产精品热久久久久夜色精品三区| 欧美美女视频在线观看| 色婷婷av一区二区三区之一色屋| 麻豆精品在线看| 首页国产丝袜综合| 五月天亚洲精品| 一区二区三区在线视频免费| 中文字幕一区二区三区在线播放| 久久久久亚洲综合| 国产亚洲一区二区三区在线观看| 精品处破学生在线二十三| 日韩亚洲欧美综合| 欧美一区日本一区韩国一区| 欧美日韩成人综合| 制服丝袜国产精品| 91精品国产乱| 日韩美一区二区三区| 欧美一区二区三区喷汁尤物| 4438x亚洲最大成人网| 3atv在线一区二区三区| 欧美久久高跟鞋激| 日韩一区二区视频| 欧美成人综合网站| 久久婷婷久久一区二区三区| 久久久美女毛片| 国产精品久久影院| 最新高清无码专区| 亚洲一区二区美女| 日韩福利视频导航| 国产精品一区二区你懂的| 国产宾馆实践打屁股91| 成人福利在线看| 成人av免费网站| 亚洲色欲色欲www| 久久久久久久久一| 在线中文字幕不卡| 色婷婷久久久亚洲一区二区三区| 色呦呦日韩精品| 欧美精品v国产精品v日韩精品| 日韩三级av在线播放| 国产视频一区在线播放| 最新热久久免费视频| 亚洲国产欧美一区二区三区丁香婷| 天天综合色天天综合色h| 狠狠色狠狠色综合系列| 成人激情综合网站| 欧美日韩国产综合视频在线观看| 日韩午夜在线观看| 日韩一区中文字幕| 亚洲综合免费观看高清完整版在线| 香蕉久久夜色精品国产使用方法 | 亚洲三级在线免费观看| 悠悠色在线精品| 视频在线观看91| 色狠狠色狠狠综合| 欧美一区二区二区| 91精品国产综合久久婷婷香蕉 | 狠狠久久亚洲欧美| www..com久久爱| 91精品国产美女浴室洗澡无遮挡| 国产日产精品1区| 日韩在线一二三区| 成人av网址在线| 精品国产1区二区| 亚洲一级在线观看| 国产成人夜色高潮福利影视| 91成人网在线| 欧美激情一区在线| 美女看a上一区| 在线观看日韩一区| 国产清纯白嫩初高生在线观看91 | 一区二区三区毛片| 国产中文一区二区三区| 欧美亚洲国产一卡| 国产精品久久久久毛片软件| 美洲天堂一区二卡三卡四卡视频| 日韩精品欧美精品| 欧美午夜影院一区| 国产a精品视频| 在线视频综合导航| 在线成人高清不卡| 在线中文字幕一区| 亚洲精品成人精品456| 成人免费三级在线| 国产高清久久久久| 4438成人网| 亚洲综合在线电影| 91亚洲男人天堂| 久久久综合网站| 久久精品国产99| 欧美日韩精品高清| 亚洲国产成人porn| 99精品视频在线观看免费| 国产女人18毛片水真多成人如厕| 激情五月播播久久久精品| 欧美一区二区精美| 秋霞电影一区二区| 91麻豆精品国产91久久久久| 亚洲综合色区另类av| 色拍拍在线精品视频8848| 亚洲欧美国产高清| 日本高清不卡视频| 捆绑调教美女网站视频一区| 国产精品超碰97尤物18|