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

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

?? core.c

?? 早期freebsd實現
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* Method dispatcher and class-object creator for Objective C.   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 "assert.h"#include <ctype.h>#include "gstdarg.h"#include <stdio.h>#include "gstddef.h"#include "hash.h"#include "objc.h"#include "objc-proto.h"#define MODULE_HASH_SIZE 32   /* Initial module hash table size.				 Value doesn't really matter.  */#define CLASS_HASH_SIZE 32    /* Initial number of buckets size of				 class hash table.  Value doesn't				 really matter.  *//* Forward declare some functions.  */id            objc_object_create (Class_t),              objc_object_dispose (id),              objc_object_realloc (id, unsigned int),              objc_object_copy (id);void          objc_error (id object, const char *fmt, va_list ap);static id     nil_method (id, SEL, ...);static id     return_error_static (id, SEL, ...);static IMP    handle_runtime_error (id, SEL);static void   initialize_dispatch_tables (void);static SEL    record_selector (const char*);static void   record_methods_from_class (Class_t);static void   record_methods_from_list (MethodList_t);static void   initialize_class (const char*);/* * This is a hash table of Class_t structures.  * * At initialization the executable is searched for all Class_t structures.  * Since these structures are created by the compiler they are therefore * located in the TEXT segment.   * * A identical structure is allocated from the free store and initialized from * its TEXT counterpart and placed in the hash table using the TEXT part as * its key.  * * Since the free store structure is now writable, additional initialization * takes place such as its "info" variable, method cache allocation, and * linking of all of its method and ivar lists from multiple implementations.  */cache_ptr	class_hash_table = NULL;/* * This variable is a flag used within the messaging routines.  If a * application sets it to !0 then the messager will print messages sent to * objects.  */BOOL  objc_trace = NO;/* This mutex provides a course lock for method dispatch.  */MUTEX	runtimeMutex;/* * This hash table is used by the initialization routines.  When the * constructor function (__objc_execClass) is called it is passed a pointer * to a module structure.  That pointer is stored in this table and its * contents are processed in __objcInit.  */cache_ptr    module_hash_table = NULL;/* * This hash table is used in the constructor subroutine to hold pointers  * to categories that have not been attached to a class.  Constructors are * received in a random order.  Files may contain category implementation * of objects whose constructor hasn't been executed yet.  Therefore,  * there is no object to attach the categories. * * This hash table holds pointers to categories that haven't been * attached to objects.  As objects are processed the category hash * table is searched for attachments.  If a category is found for the * object it is attached to the object and deleted from the hash table. */cache_ptr    unclaimed_category_hash_table = NULL;/* * This flag is used by the messager routines to determine if the run-time * has been initialized.  If the run-time isn't initialized then a * initialization clean up routine is called.  */static int	initialized = 0;/* * Records that hold pointers to arrays of records.  The terminal records are * method implementations.  * * The size of the first record is the number of unique classes in the * executable.  The second is the number of selectors.  * * The second record conatins methods that are visible to the class -- that is, * methods that are not overriden from the classt to the root object.  * * The cache pointers of class and meta class structures point to one of these * records.  */static struct record *instance_method_record	= NULL;static struct record *factory_method_record	= NULL;/* * This structure is used to translate between selectors and their ASCII * representation.  A NULL terminated array of char*, * OBJC_SELECTOR_REFERENCES, is passed to the constructor routine:  * __objc_execClass. That routine places entries from that array into this * structure.  The location within OBJC_SELECTOR_REFERENCES where the string * was taken from is replaced with a small integer, the index into the array * inside selectorTranslateTable.  That integer then becomes the selector.  * * Selectors begin at 1 to numEntries.  A selector outside of that range is * considered an error.  The selector integers are used as the first index * into the instance_method_record and factory_method_record arrays.  */static struct record *selector_record = NULL;/* * This data structure is used in the special case where usual fatal error * functions are called but have been overridden in a class.  The value * returned by that function is returned to the calling object.  error_static * holds the returned value until it is retrieved by return_error_static * which returns it to the calling function.  */static id	error_static;/* Given a class and selector, return the selector's implementation.  */static inline IMP	get_imp (Class_t class, SEL sel){  IMP	imp = NULL;  imp = record_get (getClassNumber (class),		    record_get ((unsigned int)sel, *class->cache));  return imp;}static voiderror (msg, arg1, arg2)     char *msg, *arg1, *arg2;{#if 0 /* There is no portable way to get the program name.  Too bad.  */  fprintf (stderr, "%s: ", programname);#endif  fprintf (stderr, msg, arg1, arg2);  fprintf (stderr, "\n");}static voidfatal (msg, arg1, arg2)     char *msg, *arg1, *arg2;{  error (msg, arg1, arg2);  exit (1);}static void *xmalloc (unsigned int size){  void *ptr = (void *) malloc (size);  if (ptr == 0)    fatal ("virtual memory exceeded");  return ptr;}static void *xcalloc (unsigned int size, unsigned int units){  void *ptr = (void *) calloc (size, units);  if (ptr == 0)    fatal ("virtual memory exceeded");  return ptr;}void *__objc_xmalloc (unsigned int size){  void *ptr = (void *) malloc (size);  if (ptr == 0)    fatal ("virtual memory exceeded");  return ptr;}void *__objc_xrealloc (void *optr, unsigned int size){  void *ptr = (void *) realloc (optr, size);  if (ptr == 0)    fatal ("virtual memory exceeded");  return ptr;}void *__objc_xcalloc (unsigned int size, unsigned int units){  void *ptr = (void *) calloc (size, units);  if (ptr == 0)    fatal ("virtual memory exceeded");  return ptr;}static inline char *my_strdup (const char *str){  char *new = (char *) xmalloc (strlen (str) + 1);  strcpy (new, str);	  return new;}/* * This function is called by constructor functions generated for each module * compiled.   * * The purpose of this function is to gather the module pointers so that they * may be processed by the initialization clean up routine.  */void __objc_execClass (Module_t module){  /* Has we processed any constructors previously?      Flag used to indicate that some global data structures     need to be built.  */  static BOOL previous_constructors = 0;  Symtab_t    symtab = module->symtab;  Class_t     object_class;  node_ptr node;  SEL         *(*selectors)[] = (SEL *(*)[])symtab->refs;  int         i;  BOOL        incomplete = 0;  assert (module->size == sizeof (Module));  DEBUG_PRINTF ("received load module: %s\n",module->name);  /* Header file data structure hack test.  */  assert (sizeof (Class) == sizeof (MetaClass));  /* On the first call of this routine, initialize     some data structures.  */  if (!previous_constructors) {    /* Enable malloc debugging. This'll slow'er down! */#if defined (DEBUG) && defined (NeXT)    malloc_debug (62);#endif    /* Allocate and initialize the mutex.  */    MUTEX_ALLOC (&runtimeMutex);    MUTEX_INIT (runtimeMutex);    /* Allocate the module hash table.  */    module_hash_table      = hash_new (MODULE_HASH_SIZE, (hash_func_type)hash_ptr,		  (compare_func_type)compare_ptrs);    /* Allocate a table for unclaimed categories.  */    unclaimed_category_hash_table      = hash_new (16, (hash_func_type)hash_ptr,		  (compare_func_type)compare_ptrs);    /* Allocate a master selector table if it doesn't exist.  */    selector_record = record_new ();        previous_constructors = 1;  }  /* Save the module pointer for later processing.  */  hash_add (&module_hash_table, module, module);  /* Parse the classes in the load module and gather selector information.  */  DEBUG_PRINTF ("gathering selectors from module: %s\n",module->name);  for (i = 0; i < symtab->cls_def_cnt; ++i) {    Class_t class = (Class_t)symtab->defs[i];    /* Make sure we have what we think.  */    assert (class->info & CLS_CLASS);    assert (class->class_pointer->info & CLS_META);    DEBUG_PRINTF ("phase 1, processing class: %s\n", class->name);    /* Store the class in the class table and assign class numbers.  */    addClassToHash (class);    /* Store all of the selectors in the class and meta class.  */    record_methods_from_class (class);    record_methods_from_class ((Class_t)class->class_pointer);    /* Initialize the cache pointers.  */    class->cache = &instance_method_record;    class->class_pointer->cache = &factory_method_record;  }  /* Replace referenced selectors.  */  for (i=0; i < symtab->sel_ref_cnt; ++i)    (*selectors)[i] = record_selector ((const char*)(*selectors)[i]);  /* Try to build the class hierarchy and initialize the data structures.  */  object_class = objc_getClass ("Object");  if (object_class) {        /* Make sure we have what we think we have.  */    assert (object_class->class_pointer->info & CLS_META);    assert (object_class->info & CLS_CLASS);        /* Connect the classes together (at least as much as we can).  */     for (node = hash_next (class_hash_table, NULL); node;	 node = hash_next (class_hash_table, node)) {      Class_t class1 = node->value;      /* Make sure we have what we think we have.  */      assert (class1->info & CLS_CLASS);      assert (class1->class_pointer->info & CLS_META);      /* The class_pointer of all meta classes point to Object's meta class.  */      class1->class_pointer->class_pointer = object_class->class_pointer;       /* Assign super class pointers */      if (class1->super_class) {	Class_t aSuperClass = objc_getClass ((char*)class1->super_class);	if (aSuperClass) {	  DEBUG_PRINTF ("making class connections for: %s\n", 			class1->name);	  class1->super_class = aSuperClass; 	  if (class1->class_pointer->super_class)	    class1->class_pointer->super_class = class1->super_class->class_pointer;	  /* Mark the class as initialized.  */	  class1->info |= CLS_RTI;	} else	  /* Couldn't find the class's super class.  */	  incomplete = 1;      }    }  } else    /* Couldn't find class Object.  */    incomplete = 1;  /* Process category information from the module.  */  for (i = 0; i < symtab->cat_def_cnt; ++i) {    Category_t  category = symtab->defs[i + symtab->cls_def_cnt];    Class_t     class = objc_getClass (category->class_name);    /* If the class for the category exists then append its       methods.  */    if (class) {      DEBUG_PRINTF ("processing categories from (module,object): %s, %s\n",		    module->name, 		    class_getClassName (class));      /* Do instance methods.  */      if (category->instance_methods)        addMethodsToClass (class, category->instance_methods);      /* Do class methods.  */      if (category->class_methods)        addMethodsToClass ((Class_t)class->class_pointer, category->class_methods);    } else {      /* The object to which the category methods belong can't	 be found.  Save the information.  */      hash_add (&unclaimed_category_hash_table, category, category);      incomplete = 1;    }  }  /* Scan the unclaimed category hash.       Attempt to attach any unclaimed categories to objects.  */  for (node = hash_next (unclaimed_category_hash_table, NULL); node;       node = hash_next (unclaimed_category_hash_table, node)) {    Category_t  category = node->value;    Class_t     class = objc_getClass (category->class_name);    if (class) {      DEBUG_PRINTF ("attaching stored categories to object: %s\n",		    class_getClassName (class));      /* Delete this class from the hash table.  */      hash_remove (unclaimed_category_hash_table, category);      node = NULL;      if (category->instance_methods)	addMethodsToClass (class, category->instance_methods);      if (category->class_methods)	addMethodsToClass ((Class_t)class->class_pointer,			   category->class_methods);    } else      incomplete = 1;  }  /* Can we finish the run time initialization? */  if (!incomplete) {    initialize_dispatch_tables ();    /* Debug run time test.       We're initialized! */    initialized = 1;    /* Print out class tables if debugging.  */    DEBUG_PRINTF ("dump of class tables from objcInit\n");    debug_dump_classes ();  }}IMP  objc_msgSend (id receiver, SEL sel){  /*   * A method is always called by the compiler.  If a method wasn't   * found then supply a default.    */  IMP  imp = nil_method;  /* The run time must be initialized at this point.     Otherwise we get a message sent to a object with a bogus selector.  */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜桃视频在线一区| 国产自产v一区二区三区c| 欧美一级理论片| 99精品视频在线播放观看| 日本欧美久久久久免费播放网| 亚洲国产激情av| 日韩片之四级片| 日本久久一区二区| 国产成人免费视频精品含羞草妖精| 亚洲一区二区不卡免费| 亚洲国产高清在线| 精品嫩草影院久久| 欧美日韩高清影院| 色综合天天在线| 国产精品一级片在线观看| 日本欧美一区二区| 亚洲午夜在线视频| 亚洲欧洲av在线| 国产夜色精品一区二区av| 91精品国产麻豆| 欧美日韩国产在线观看| 色综合久久九月婷婷色综合| 精品一区二区三区在线观看| 免费高清不卡av| 天天免费综合色| 亚洲成a人在线观看| 一区二区久久久久久| 中文字幕一区二区三区蜜月| 国产区在线观看成人精品 | 精品一区精品二区高清| 日韩影院精彩在线| 午夜成人在线视频| 天天影视涩香欲综合网| 香港成人在线视频| 亚洲国产精品视频| 亚洲一级片在线观看| 一区二区三区在线视频免费观看| 国产精品视频九色porn| 国产精品国产馆在线真实露脸| 久久久久97国产精华液好用吗| 久久久五月婷婷| 久久久久久99精品| 欧美激情一区二区三区在线| 久久久www免费人成精品| 国产亚洲一区二区在线观看| 欧美激情一区二区| 国产精品国产成人国产三级| 日韩伦理av电影| 亚洲综合在线视频| 亚洲国产日韩精品| 日韩福利视频导航| 石原莉奈在线亚洲二区| 日本在线不卡一区| 黑人巨大精品欧美一区| 精品一区二区三区免费观看| 国产99久久久国产精品潘金 | 久久综合一区二区| 国产色爱av资源综合区| 国产精品人妖ts系列视频| 最新日韩在线视频| 亚洲国产三级在线| 蜜臀91精品一区二区三区| 久久99九九99精品| 成人久久久精品乱码一区二区三区| 色综合久久综合网| 7777精品伊人久久久大香线蕉的 | 亚洲黄色小视频| 日韩精品电影在线观看| 狠狠色综合日日| 成人国产精品免费观看| 欧美日韩综合在线免费观看| 日韩免费视频一区| 国产精品九色蝌蚪自拍| 亚洲一区二区视频在线观看| 久久国产欧美日韩精品| a亚洲天堂av| 欧美人妇做爰xxxⅹ性高电影| 日韩欧美精品在线视频| 1024精品合集| 另类小说图片综合网| 97se亚洲国产综合自在线观| 3751色影院一区二区三区| 久久久久久亚洲综合影院红桃| 日韩理论电影院| 激情图片小说一区| 在线亚洲人成电影网站色www| 日韩三级av在线播放| 亚洲欧洲99久久| 久久精品久久精品| 在线亚洲+欧美+日本专区| 亚洲精品一区二区三区精华液| 亚洲视频一区在线| 国内精品免费**视频| 欧美色网一区二区| 中文字幕av一区 二区| 天天色天天操综合| 一本久道久久综合中文字幕| 久久久久久影视| 强制捆绑调教一区二区| 日本国产一区二区| 国产精品水嫩水嫩| 九九国产精品视频| 欧美日韩亚洲综合在线 | 69久久夜色精品国产69蝌蚪网| 日本一区二区三区四区在线视频| 日日夜夜精品免费视频| 日本韩国精品在线| 中文字幕一区在线观看视频| 久久国产尿小便嘘嘘| 精品视频在线免费| 亚洲激情五月婷婷| 成人黄色小视频| 久久久久国产免费免费| 久久99久久99小草精品免视看| 欧美精品 国产精品| 亚洲一区成人在线| 色综合天天综合网天天狠天天| 国产精品久久久久一区二区三区共| 久久99精品久久久| 欧美一二三在线| 日本免费在线视频不卡一不卡二| 欧美在线观看一区二区| 亚洲人成网站在线| 91麻豆精品一区二区三区| 中文字幕在线观看不卡| 国产成人av电影在线| 国产日韩精品久久久| 国产成人丝袜美腿| 中文字幕乱码一区二区免费| 国产99久久久精品| 国产精品无圣光一区二区| 国产成人在线免费观看| 欧美国产精品一区二区| 丰满放荡岳乱妇91ww| 国产午夜精品福利| 成人午夜av影视| 成人免费在线观看入口| 色狠狠综合天天综合综合| 亚洲精品中文字幕乱码三区| 一本高清dvd不卡在线观看| 一区二区三区产品免费精品久久75| 日本乱人伦一区| 亚洲国产精品欧美一二99| 欧美日韩精品福利| 奇米777欧美一区二区| 日韩一区二区视频在线观看| 麻豆精品在线播放| 26uuu成人网一区二区三区| 久久国内精品自在自线400部| 91精品国产色综合久久不卡蜜臀 | 亚洲视频中文字幕| 欧美在线看片a免费观看| 亚洲国产视频网站| 日韩色在线观看| 久久se精品一区精品二区| 国产调教视频一区| 亚洲va中文字幕| 欧美不卡一区二区三区| 高清国产一区二区| 国产精品国产成人国产三级| 欧美日韩精品一区视频| 天天色天天操综合| 久久久久久亚洲综合| 成人黄色综合网站| 亚洲三级免费观看| 欧美一区国产二区| 黄色日韩网站视频| 亚洲精品中文字幕乱码三区| 欧美日韩的一区二区| 国产精品伊人色| 亚洲精品久久久蜜桃| 欧美日韩mp4| 粉嫩一区二区三区性色av| 亚洲人成精品久久久久| 欧美一区二区福利视频| 麻豆高清免费国产一区| 欧美国产综合一区二区| 欧美日韩一区视频| 久色婷婷小香蕉久久| 亚洲乱码一区二区三区在线观看| 99精品热视频| 久久精品国产免费看久久精品| 国产精品灌醉下药二区| 日本高清视频一区二区| 国产一区二区精品久久99| 日韩理论片中文av| 久久综合久久综合九色| 色视频一区二区| 麻豆国产精品官网| 亚洲视频1区2区| 日韩丝袜美女视频| 成人国产精品视频| 日产国产欧美视频一区精品 | 日韩欧美不卡在线观看视频| 91免费看视频| 丁香婷婷综合五月| 五月婷婷久久丁香| 亚洲色图欧洲色图婷婷| 欧美xxx久久| 7777女厕盗摄久久久|