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

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

?? hash.c

?? 早期freebsd實現(xiàn)
?? C
字號:
/* Hash tables for Objective C method dispatch.   Copyright (C) 1992 Free Software Foundation, Inc.This file is part of GNU CC.GNU CC is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2, or (at your option)any later version.GNU CC is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with GNU CC; see the file COPYING.  If not, write tothe Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  *//* As a special exception, if you link this library with files   compiled with GCC to produce an executable, this does not cause   the resulting executable to be covered by the GNU General Public License.   This exception does not however invalidate any other reasons why   the executable file might be covered by the GNU General Public License.  */#include "tconfig.h"#include "gstddef.h"#include "gstdarg.h"#include "assert.h"#include "hash.h"#include "objc.h"#include "objc-proto.h"/* These two macros determine when a hash table is full and   by how much it should be expanded respectively.   These equations are percentages.  */#define FULLNESS(cache) \   ((((cache)->size * 75) / 100) <= (cache)->used)#define EXPANSION(cache) \  ((cache)->size * 2)cache_ptrhash_new (unsigned int size, hash_func_type hash_func,	  compare_func_type compare_func){  cache_ptr cache;  /* Pass me a value greater than 0 and a power of 2.  */  assert (size);  assert (!(size & (size - 1)));  /* Allocate the cache structure.  calloc insures     its initialization for default values.  */  cache = (cache_ptr) calloc (1, sizeof (struct cache));  assert (cache);  /* Allocate the array of buckets for the cache.     calloc initializes all of the pointers to NULL.  */  cache->node_table    = (node_ptr *) calloc (size, sizeof (node_ptr));  assert (cache->node_table);  cache->size  = size;  /* This should work for all processor architectures? */  cache->mask = (size - 1);	  /* Store the hashing function so that codes can be computed.  */  cache->hash_func = hash_func;  /* Store the function that compares hash keys to     determine if they are equal.  */  cache->compare_func = compare_func;  return cache;}voidhash_delete (cache_ptr cache){  node_ptr node;  /* Purge all key/value pairs from the table.  */  while (node = hash_next (cache, NULL))    hash_remove (cache, node->key);  /* Release the array of nodes and the cache itself.  */  free (cache->node_table);  free (cache);}voidhash_add (cache_ptr *cachep, const void *key, void *value){  size_t indx = (*(*cachep)->hash_func)(*cachep, key);  node_ptr node = (node_ptr) calloc (1, sizeof (struct cache_node));  assert (node);  /* Initialize the new node.  */  node->key    = key;  node->value  = value;  node->next  = (*cachep)->node_table[indx];  /* Debugging.     Check the list for another key.  */#ifdef DEBUG  { node_ptr node1 = (*cachep)->node_table[indx];    while (node1) {      assert (node1->key != key);      node1 = node1->next;    }  }#endif  /* Install the node as the first element on the list.  */  (*cachep)->node_table[indx] = node;  /* Bump the number of entries in the cache.  */  ++(*cachep)->used;  /* Check the hash table's fullness.   We're going     to expand if it is above the fullness level.  */  if (FULLNESS (*cachep)) {    /* The hash table has reached its fullness level.  Time to       expand it.       I'm using a slow method here but is built on other       primitive functions thereby increasing its       correctness.  */    node_ptr node1 = NULL;    cache_ptr new = hash_new (EXPANSION (*cachep),			      (*cachep)->hash_func,			      (*cachep)->compare_func);    DEBUG_PRINTF ("Expanding cache %#x from %d to %d\n",		  *cachep, (*cachep)->size, new->size);    /* Copy the nodes from the first hash table to the new one.  */    while (node1 = hash_next (*cachep, node1))      hash_add (&new, node1->key, node1->value);    /* Trash the old cache.  */    hash_delete (*cachep);    /* Return a pointer to the new hash table.  */    *cachep = new;  }}voidhash_remove (cache_ptr cache, const void *key){  size_t indx = (*cache->hash_func)(cache, key);  node_ptr node = cache->node_table[indx];  /* We assume there is an entry in the table.  Error if it is not.  */  assert (node);  /* Special case.  First element is the key/value pair to be removed.  */  if ((*cache->compare_func)(node->key, key)) {    cache->node_table[indx] = node->next;    free (node);  } else {    /* Otherwise, find the hash entry.  */    node_ptr prev = node;    BOOL removed = NO;    do {      if ((*cache->compare_func)(node->key, key)) {        prev->next = node->next, removed = YES;        free (node);      } else        prev = node, node = node->next;    } while (!removed && node);    assert (removed);  }  /* Decrement the number of entries in the hash table.  */  --cache->used;}node_ptrhash_next (cache_ptr cache, node_ptr node){  /* If the scan is being started then reset the last node     visitied pointer and bucket index.  */  if (!node)    cache->last_bucket  = 0;  /* If there is a node visited last then check for another     entry in the same bucket;  Otherwise step to the next bucket.  */  if (node) {    if (node->next)      /* There is a node which follows the last node	 returned.  Step to that node and retun it.  */      return node->next;    else      ++cache->last_bucket;  }  /* If the list isn't exhausted then search the buckets for     other nodes.  */  if (cache->last_bucket < cache->size) {    /*  Scan the remainder of the buckets looking for an entry	at the head of the list.  Return the first item found.  */    while (cache->last_bucket < cache->size)      if (cache->node_table[cache->last_bucket])        return cache->node_table[cache->last_bucket];      else        ++cache->last_bucket;    /* No further nodes were found in the hash table.  */    return NULL;  } else    return NULL;}/* Given KEY, return corresponding value for it in CACHE.   Return NULL if the KEY is not recorded.  */void *hash_value_for_key (cache_ptr cache, const void *key){  node_ptr node = cache->node_table[(*cache->hash_func)(cache, key)];  void *retval = NULL;  if (node)    do {      if ((*cache->compare_func)(node->key, key))        retval = node->value;      else        node = node->next;    } while (!retval && node);  return retval;}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区久久久久久| 亚洲欧美在线高清| 欧洲一区在线电影| 99久久伊人精品| 成人aa视频在线观看| av亚洲精华国产精华精华| 国产精品一区二区三区四区| 经典三级视频一区| 国产精品亚洲专一区二区三区| 久久99精品国产91久久来源| 狠狠色丁香婷婷综合| 国产高清无密码一区二区三区| 粉嫩蜜臀av国产精品网站| 99国产精品一区| 欧美老年两性高潮| 欧美成人免费网站| 国产精品色噜噜| 一区二区三区四区精品在线视频| 亚洲国产欧美日韩另类综合| 偷偷要91色婷婷| 九色综合狠狠综合久久| 粉嫩在线一区二区三区视频| 色噜噜狠狠成人中文综合| 欧美日本一区二区| 国产欧美一区二区三区网站| 一区二区三区波多野结衣在线观看| 午夜视黄欧洲亚洲| 成人白浆超碰人人人人| 欧美另类变人与禽xxxxx| 久久综合狠狠综合久久综合88| 国产日韩av一区| 五月天激情综合网| av一区二区久久| 欧美大片拔萝卜| 亚洲日本在线视频观看| 麻豆成人91精品二区三区| www.欧美日韩| 欧美不卡一区二区| 亚洲午夜激情网页| 国产91精品在线观看| 欧美高清视频www夜色资源网| 中文字幕第一区二区| 日韩中文字幕麻豆| 99精品视频在线观看| 精品久久久久久久久久久久久久久 | 国产精品女人毛片| 亚洲成av人影院| 成人综合在线观看| 日韩一级视频免费观看在线| 亚洲人吸女人奶水| 国产成人日日夜夜| 日韩欧美成人午夜| 亚洲高清三级视频| 91丨porny丨首页| 国产亚洲欧美在线| 麻豆精品一区二区| 666欧美在线视频| 自拍偷拍亚洲激情| 国产成人精品一区二区三区网站观看| 欧美区在线观看| 婷婷一区二区三区| 91啪在线观看| 亚洲欧美国产高清| 91一区一区三区| 中文字幕成人网| 成人激情小说网站| 国产视频一区二区在线| 国产综合色视频| 精品99一区二区| 青青草国产精品97视觉盛宴| 欧美在线免费播放| 亚洲永久免费av| 欧美在线三级电影| 日韩专区中文字幕一区二区| 4438x成人网最大色成网站| 天堂av在线一区| 欧美一级精品在线| 黑人巨大精品欧美一区| 久久久av毛片精品| 成人午夜视频在线| 亚洲三级视频在线观看| 欧美综合一区二区三区| 亚洲午夜在线电影| 欧美一区二区三区视频| 久久精品免费看| 国产日韩精品一区二区三区| 成人精品在线视频观看| 中文字幕一区在线观看| 欧美亚洲综合另类| 美女网站色91| 中文成人av在线| 欧美在线小视频| 激情久久五月天| ...xxx性欧美| 欧美一区欧美二区| 丁香网亚洲国际| 亚洲午夜一二三区视频| 精品国产网站在线观看| 成人美女视频在线观看18| 一区二区国产视频| 精品日韩成人av| 成人av网站在线观看| 午夜精品福利久久久| 久久这里只有精品6| 色综合欧美在线| 日韩精品高清不卡| 欧美国产乱子伦| 欧美日韩黄视频| 大白屁股一区二区视频| 天天操天天色综合| 国产精品毛片高清在线完整版| 在线日韩一区二区| 国产精品一区一区| 亚洲成人激情av| 国产精品欧美一区二区三区| 91精品国产一区二区三区香蕉| 国产99久久精品| 奇米777欧美一区二区| 亚洲视频一二三| 久久综合色播五月| 8v天堂国产在线一区二区| 99在线精品视频| 国产在线观看免费一区| 午夜av电影一区| 一区免费观看视频| 久久久午夜精品| 日韩一区二区在线观看视频 | 麻豆精品视频在线观看免费| 国产精品美女久久久久久久网站| 欧美日韩电影在线| 色婷婷亚洲综合| 国产99久久久国产精品| 韩国精品在线观看| 日日骚欧美日韩| 一区二区高清在线| 亚洲日本在线看| 中文字幕一区二区三区av| 久久这里只有精品6| 日韩精品一区二区在线| 欧美视频在线观看一区| 91麻豆文化传媒在线观看| 成人高清在线视频| 成人av资源在线| av网站免费线看精品| 成人激情动漫在线观看| 成人蜜臀av电影| 不卡av在线网| 99re8在线精品视频免费播放| 国产成人激情av| 国产91丝袜在线播放0| 国产.欧美.日韩| 亚洲va欧美va天堂v国产综合| 国产午夜精品一区二区| 国产欧美日韩亚州综合| 欧美国产日韩在线观看| 国产精品国产精品国产专区不蜜| 国产婷婷精品av在线| 中国av一区二区三区| 国产精品久久夜| 亚洲精品菠萝久久久久久久| 一级做a爱片久久| 亚洲午夜三级在线| 午夜电影一区二区| 日韩高清在线不卡| 国产专区欧美精品| 国产一区二区三区香蕉| 丰满少妇在线播放bd日韩电影| 风流少妇一区二区| 色妞www精品视频| 欧美日韩在线亚洲一区蜜芽| 欧美一区二区不卡视频| 欧美精品一区二区在线观看| 国产精品久久久久久久蜜臀| 日韩伦理av电影| 亚洲chinese男男1069| 久久成人综合网| 成人午夜av电影| 欧美日韩免费在线视频| 久久久久国产精品麻豆ai换脸 | 蜜臀va亚洲va欧美va天堂| 国产真实乱偷精品视频免| 91亚洲永久精品| 日韩视频在线永久播放| 日韩理论片在线| 蜜桃av一区二区| av在线综合网| 日韩美女视频在线| 亚洲天堂成人在线观看| 日本亚洲三级在线| 国产91在线观看丝袜| 欧美群妇大交群的观看方式| 久久久久久久久久美女| 一区二区高清免费观看影视大全 | 亚洲国产精品久久人人爱蜜臀 | 精品视频一区二区不卡| 国产亚洲精久久久久久| 日产欧产美韩系列久久99| av不卡一区二区三区| 日韩一级大片在线观看| 一区二区三区四区在线播放|