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

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

?? class.c

?? gcc的組件
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* GNU Objective C Runtime class related functions   Copyright (C) 1993, 1995, 1996, 1997, 2001, 2002     Free Software Foundation, Inc.   Contributed by Kresten Krab Thorup and Dennis Glatting.   Lock-free class table code designed and written from scratch by   Nicola Pero, 2001.This file is part of GCC.GCC is free software; you can redistribute it and/or modify it under theterms of the GNU General Public License as published by the Free SoftwareFoundation; either version 2, or (at your option) any later version.GCC is distributed in the hope that it will be useful, but WITHOUT ANYWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESSFOR A PARTICULAR PURPOSE.  See the GNU General Public License for moredetails.You should have received a copy of the GNU General Public License along withGCC; see the file COPYING.  If not, write to the Free SoftwareFoundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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.  *//*  The code in this file critically affects class method invocation  speed.  This long preamble comment explains why, and the issues  involved.    One of the traditional weaknesses of the GNU Objective-C runtime is  that class method invocations are slow.  The reason is that when you  write    array = [NSArray new];    this gets basically compiled into the equivalent of     array = [(objc_get_class ("NSArray")) new];    objc_get_class returns the class pointer corresponding to the string  `NSArray'; and because of the lookup, the operation is more  complicated and slow than a simple instance method invocation.      Most high performance Objective-C code (using the GNU Objc runtime)  I had the opportunity to read (or write) work around this problem by  caching the class pointer:    Class arrayClass = [NSArray class];    ... later on ...    array = [arrayClass new];  array = [arrayClass new];  array = [arrayClass new];    In this case, you always perform a class lookup (the first one), but  then all the [arrayClass new] methods run exactly as fast as an  instance method invocation.  It helps if you have many class method  invocations to the same class.      The long-term solution to this problem would be to modify the  compiler to output tables of class pointers corresponding to all the  class method invocations, and to add code to the runtime to update  these tables - that should in the end allow class method invocations  to perform precisely as fast as instance method invocations, because  no class lookup would be involved.  I think the Apple Objective-C  runtime uses this technique.  Doing this involves synchronized  modifications in the runtime and in the compiler.      As a first medicine to the problem, I [NP] have redesigned and  rewritten the way the runtime is performing class lookup.  This  doesn't give as much speed as the other (definitive) approach, but  at least a class method invocation now takes approximately 4.5 times  an instance method invocation on my machine (it would take approx 12  times before the rewriting), which is a lot better.    One of the main reason the new class lookup is so faster is because  I implemented it in a way that can safely run multithreaded without  using locks - a so-called `lock-free' data structure.  The atomic  operation is pointer assignment.  The reason why in this problem  lock-free data structures work so well is that you never remove  classes from the table - and the difficult thing with lock-free data  structures is freeing data when is removed from the structures.  */#include "objc/runtime.h"            /* the kitchen sink */#include "objc/sarray.h"#include "objc/objc.h"#include "objc/objc-api.h"#include "objc/thr.h"/* We use a table which maps a class name to the corresponding class * pointer.  The first part of this file defines this table, and * functions to do basic operations on the table.  The second part of * the file implements some higher level Objective-C functionality for * classes by using the functions provided in the first part to manage * the table. *//** ** Class Table Internals **//* A node holding a class */typedef struct class_node{  struct class_node *next;      /* Pointer to next entry on the list.                                   NULL indicates end of list. */    const char *name;             /* The class name string */  int length;                   /* The class name string length */  Class pointer;                /* The Class pointer */  } *class_node_ptr;/* A table containing classes is a class_node_ptr (pointing to the   first entry in the table - if it is NULL, then the table is   empty). *//* We have 1024 tables.  Each table contains all class names which   have the same hash (which is a number between 0 and 1023).  To look   up a class_name, we compute its hash, and get the corresponding   table.  Once we have the table, we simply compare strings directly   till we find the one which we want (using the length first).  The   number of tables is quite big on purpose (a normal big application   has less than 1000 classes), so that you shouldn't normally get any   collisions, and get away with a single comparison (which we can't   avoid since we need to know that you have got the right thing).  */#define CLASS_TABLE_SIZE 1024#define CLASS_TABLE_MASK 1023static class_node_ptr class_table_array[CLASS_TABLE_SIZE];/* The table writing mutex - we lock on writing to avoid conflicts   between different writers, but we read without locks.  That is   possible because we assume pointer assignment to be an atomic   operation.  */static objc_mutex_t __class_table_lock = NULL;/* CLASS_TABLE_HASH is how we compute the hash of a class name.  It is   a macro - *not* a function - arguments *are* modified directly.     INDEX should be a variable holding an int;   HASH should be a variable holding an int;   CLASS_NAME should be a variable holding a (char *) to the class_name.     After the macro is executed, INDEX contains the length of the   string, and HASH the computed hash of the string; CLASS_NAME is   untouched.  */#define CLASS_TABLE_HASH(INDEX, HASH, CLASS_NAME)          \  HASH = 0;                                                  \  for (INDEX = 0; CLASS_NAME[INDEX] != '\0'; INDEX++)        \    {                                                        \      HASH = (HASH << 4) ^ (HASH >> 28) ^ CLASS_NAME[INDEX]; \    }                                                        \                                                             \  HASH = (HASH ^ (HASH >> 10) ^ (HASH >> 20)) & CLASS_TABLE_MASK;/* Setup the table.  */static voidclass_table_setup (void){  /* Start - nothing in the table.  */  memset (class_table_array, 0, sizeof (class_node_ptr) * CLASS_TABLE_SIZE);  /* The table writing mutex.  */  __class_table_lock = objc_mutex_allocate ();}/* Insert a class in the table (used when a new class is registered).  */static void class_table_insert (const char *class_name, Class class_pointer){  int hash, length;  class_node_ptr new_node;  /* Find out the class name's hash and length.  */  CLASS_TABLE_HASH (length, hash, class_name);    /* Prepare the new node holding the class.  */  new_node = objc_malloc (sizeof (struct class_node));  new_node->name = class_name;  new_node->length = length;  new_node->pointer = class_pointer;  /* Lock the table for modifications.  */  objc_mutex_lock (__class_table_lock);    /* Insert the new node in the table at the beginning of the table at     class_table_array[hash].  */  new_node->next = class_table_array[hash];  class_table_array[hash] = new_node;    objc_mutex_unlock (__class_table_lock);}/* Replace a class in the table (used only by poseAs:).  */static void class_table_replace (Class old_class_pointer, Class new_class_pointer){  int hash;  class_node_ptr node;  objc_mutex_lock (__class_table_lock);    hash = 0;  node = class_table_array[hash];    while (hash < CLASS_TABLE_SIZE)    {      if (node == NULL)        {          hash++;          if (hash < CLASS_TABLE_SIZE)            {              node = class_table_array[hash];            }        }      else        {          Class class1 = node->pointer;          if (class1 == old_class_pointer)            {              node->pointer = new_class_pointer;            }          node = node->next;        }    }  objc_mutex_unlock (__class_table_lock);}/* Get a class from the table.  This does not need mutex protection.   Currently, this function is called each time you call a static   method, this is why it must be very fast.  */static inline Class class_table_get_safe (const char *class_name){  class_node_ptr node;    int length, hash;  /* Compute length and hash.  */  CLASS_TABLE_HASH (length, hash, class_name);    node = class_table_array[hash];    if (node != NULL)    {      do        {          if (node->length == length)            {              /* Compare the class names.  */              int i;              for (i = 0; i < length; i++)                {                  if ((node->name)[i] != class_name[i])                     {                      break;                    }                }                            if (i == length)                {                  /* They are equal!  */                  return node->pointer;                }            }        }      while ((node = node->next) != NULL);    }  return Nil;}/* Enumerate over the class table.  */struct class_table_enumerator{  int hash;  class_node_ptr node;};static Classclass_table_next (struct class_table_enumerator **e){  struct class_table_enumerator *enumerator = *e;  class_node_ptr next;    if (enumerator == NULL)    {       *e = objc_malloc (sizeof (struct class_table_enumerator));      enumerator = *e;      enumerator->hash = 0;      enumerator->node = NULL;      next = class_table_array[enumerator->hash];    }  else    {      next = enumerator->node->next;    }    if (next != NULL)    {      enumerator->node = next;      return enumerator->node->pointer;    }  else     {      enumerator->hash++;           while (enumerator->hash < CLASS_TABLE_SIZE)        {          next = class_table_array[enumerator->hash];          if (next != NULL)            {              enumerator->node = next;              return enumerator->node->pointer;            }          enumerator->hash++;        }            /* Ok - table finished - done.  */      objc_free (enumerator);      return Nil;    }}#if 0 /* DEBUGGING FUNCTIONS *//* Debugging function - print the class table.  */voidclass_table_print (void){  int i;    for (i = 0; i < CLASS_TABLE_SIZE; i++)    {      class_node_ptr node;            printf ("%d:\n", i);      node = class_table_array[i];

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人小视频免费观看| 国产女人aaa级久久久级| 精品国一区二区三区| 国产精品久久久久久久午夜片| 亚洲一区二区三区美女| 成人爽a毛片一区二区免费| 欧美精品777| 一区二区三区在线观看视频| 国产成人在线观看| 91精品国产日韩91久久久久久| 亚洲日本在线天堂| 国内成人免费视频| 日韩美女一区二区三区四区| 亚洲综合久久av| 91理论电影在线观看| 国产欧美视频一区二区| 精品一区二区三区久久| 欧美精选在线播放| 亚洲综合色成人| 91精品办公室少妇高潮对白| 国产精品久久久久久久久免费樱桃| 男人的天堂亚洲一区| 欧美三级中文字| 一区二区三区高清不卡| 色婷婷久久久综合中文字幕| 中文字幕一区二区在线观看| 成人午夜电影网站| 国产精品久久久久婷婷| 国产成人精品影视| 久久精品一区二区三区四区| 国产真实乱对白精彩久久| 欧美精品日韩综合在线| 日韩国产欧美三级| 91精品国产综合久久精品| 视频一区在线播放| 欧美成人艳星乳罩| 激情偷乱视频一区二区三区| 久久综合资源网| 国产精品系列在线观看| 国产目拍亚洲精品99久久精品| 丁香另类激情小说| 日韩伦理电影网| 欧美亚洲高清一区二区三区不卡| 夜夜嗨av一区二区三区| 这里只有精品99re| 精品系列免费在线观看| 国产亚洲一二三区| 色综合咪咪久久| 无吗不卡中文字幕| 日韩一级片在线播放| 国产在线播放一区二区三区| 国产亚洲欧美激情| 91美女视频网站| 天天色 色综合| 精品国产乱码久久久久久牛牛| 国产精品一区二区在线看| 中文在线一区二区| 91国产精品成人| 久久99精品国产| 国产精品国产三级国产aⅴ入口| 日本高清不卡在线观看| 免费在线观看日韩欧美| 中文字幕不卡在线| 欧美日韩在线精品一区二区三区激情 | 国产一区二区三区久久久| 国产精品毛片高清在线完整版| 色域天天综合网| 裸体在线国模精品偷拍| 国产精品看片你懂得| 欧美三区免费完整视频在线观看| 激情深爱一区二区| 一个色妞综合视频在线观看| 26uuu久久天堂性欧美| 在线观看视频91| 国产精品中文欧美| 肉色丝袜一区二区| 最新国产成人在线观看| 日韩亚洲欧美在线| 成人精品视频一区| 精彩视频一区二区| 天堂va蜜桃一区二区三区漫画版| 国产精品久久久久三级| 久久影院午夜论| 欧美日本一区二区三区四区| 成人免费看黄yyy456| 免费看欧美美女黄的网站| 亚洲乱码中文字幕| 欧美国产一区在线| 精品欧美久久久| 欧美美女网站色| 色婷婷av一区| 亚洲午夜免费视频| 亚洲日本va午夜在线影院| 欧美电视剧免费全集观看| 91在线视频观看| 国产主播一区二区| 韩国女主播一区| 亚洲成人免费影院| 国产精品盗摄一区二区三区| 日韩一区二区精品在线观看| 99re热这里只有精品视频| 石原莉奈在线亚洲三区| 亚洲国产美国国产综合一区二区| 国产欧美一区二区精品性色| 欧美一区二区三区不卡| 国产在线精品一区二区三区不卡| 亚洲成人免费视| 亚洲男人的天堂一区二区| 亚洲国产精品激情在线观看| 欧美精品一区二区蜜臀亚洲| 91麻豆精品国产91久久久久久久久| 不卡视频一二三| 国产精品影视网| 精品一区二区国语对白| 久久久久久久久久看片| 久久久久久久久久久99999| 日韩一级二级三级| 欧美久久高跟鞋激| 在线电影国产精品| 欧美另类久久久品| 成人免费三级在线| 色综合久久天天综合网| 97精品久久久午夜一区二区三区 | 亚洲一区二区在线播放相泽| 中文字幕一区不卡| 国产精品―色哟哟| 亚洲日本青草视频在线怡红院| 国产日本欧美一区二区| 国产亚洲成av人在线观看导航| 精品国产乱子伦一区| 26uuu亚洲综合色欧美 | 亚洲国产精品久久不卡毛片| 一区二区三区四区高清精品免费观看| 国产精品乱码妇女bbbb| 国产欧美一区二区三区鸳鸯浴| 国产精品电影院| 亚洲女同ⅹxx女同tv| 亚洲黄色性网站| 亚洲第一综合色| 日韩精品乱码免费| 天天亚洲美女在线视频| 国产一区二区三区蝌蚪| gogo大胆日本视频一区| 色哟哟日韩精品| 欧美精品123区| 日韩欧美中文一区| 国产精品久久一卡二卡| 亚洲欧美偷拍卡通变态| 亚洲综合色噜噜狠狠| 日韩国产精品大片| 韩国一区二区视频| 成人的网站免费观看| 欧美日韩亚洲不卡| 欧美成人伊人久久综合网| 国产欧美日韩不卡| 亚洲最新在线观看| 青青草91视频| 91行情网站电视在线观看高清版| 欧美高清dvd| 国产日韩精品视频一区| 亚洲一区影音先锋| 韩国av一区二区| 日本道色综合久久| 日韩美女在线视频| 亚洲一区免费视频| 韩国理伦片一区二区三区在线播放| 粉嫩在线一区二区三区视频| 欧美一a一片一级一片| 精品成人佐山爱一区二区| 一区二区三区久久久| 极品少妇xxxx精品少妇| 91亚洲精品乱码久久久久久蜜桃| 欧美色精品天天在线观看视频| 欧美成人三级电影在线| 午夜精品久久久久久| 丁香婷婷深情五月亚洲| 欧美丰满美乳xxx高潮www| 欧美激情一区在线| 日韩和的一区二区| 99久精品国产| 国产亚洲欧美激情| 免费久久精品视频| 欧亚一区二区三区| 国产亚洲污的网站| 毛片不卡一区二区| 日韩欧美一级精品久久| 亚洲精品视频一区| 国产aⅴ综合色| 日韩欧美你懂的| 免费观看日韩电影| 欧美午夜精品久久久久久孕妇| 久久久精品欧美丰满| 免费在线欧美视频| 欧美中文字幕亚洲一区二区va在线| 久久久久国产精品厨房| 日韩vs国产vs欧美| 欧美三级在线播放| 图片区小说区国产精品视频| 色先锋资源久久综合| 中文在线免费一区三区高中清不卡|