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

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

?? dom_atomicstring.cpp

?? It is WEB browser core module with source code. Very good!
?? CPP
字號:
/*
 * This file is part of the DOM implementation for KDE.
 *
 * Copyright (C) 2004 Apple Computer, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 *
 */

// For KHTML we need to avoid having static constructors.
// Our strategy is to declare the global objects with a different type (initialized to 0)
// and then use placement new to initialize the global objects later. This is not completely
// portable, and it would be good to figure out a 100% clean way that still avoids code that
// runs at init time.

#if APPLE_CHANGES && !NOKIA_CHANGES // the trick doesn't quite work with CW
#define AVOID_STATIC_CONSTRUCTORS 1
#endif

#if AVOID_STATIC_CONSTRUCTORS
#define KHTML_ATOMICSTRING_HIDE_GLOBALS 1
#endif

#include "dom_atomicstring.h"
#include "xml/dom_stringimpl.h"

#ifdef __OOM__
#include <allocs.h>
#endif

namespace DOM {
   
#define DUMP_STATISTICS 0

#if DUMP_STATISTICS
    
static int numProbes;
static int numCollisions;

struct AtomicStringStatisticsExitLogger { ~AtomicStringStatisticsExitLogger(); };

static AtomicStringStatisticsExitLogger logger;

AtomicStringStatisticsExitLogger::~AtomicStringStatisticsExitLogger()
{
    printf("\nDOM::AtomicString statistics\n\n");
    printf("%d probes\n", numProbes);
    printf("%d collisions (%.1f%%)\n", numCollisions, 100.0 * numCollisions / numProbes);
}

#endif

const int _minTableSize = 64;

DOMStringImpl **AtomicString::_table;
int AtomicString::_tableSize;
int AtomicString::_tableSizeMask;
int AtomicString::_keyCount;

bool AtomicString::equal(DOMStringImpl *r, const char *s)
{
    if (!r && !s) return true;
    if (!r || !s) return false;

    int length = r->l;
    const QChar *d = r->s;
    for (int i = 0; i != length; ++i)
        if (d[i] != s[i])
            return false;
    return s[length] == 0;
}

bool AtomicString::equal(DOMStringImpl *r, const QChar *s, uint length)
{
    if (!r && !s) return true;
    if (!r || !s) return false;
    
    if (r->l != length)
        return false;
    const QChar *d = r->s;
    for (uint i = 0; i != length; ++i)
        if (d[i] != s[i])
            return false;
    return true;
}

bool AtomicString::equal(DOMStringImpl *r, DOMStringImpl *b)
{
    if (r == b) return true;
    if (!r || !b) return false;
    uint length = r->l;
    if (length != b->l)
        return false;
    const QChar *d = r->s;
    const QChar *s = b->s;
    for (uint i = 0; i != length; ++i)
        if (d[i] != s[i])
            return false;
    return true;
}

DOMStringImpl *AtomicString::add(const char *c)
{
    if (!c)
        return 0;
    int length = strlen(c);
    if (length == 0)
        return DOMStringImpl::empty();
    
    if (!_table)
        expand();
    
    unsigned hash = DOMStringImpl::computeHash(c);
    
    int i = hash & _tableSizeMask;
#if DUMP_STATISTICS
    ++numProbes;
    numCollisions += _table[i] && !equal(_table[i], c);
#endif
    while (DOMStringImpl *key = _table[i]) {
        if (equal(key, c))
            return key;
        i = (i + 1) & _tableSizeMask;
    }
    
    DOMStringImpl *r = new DOMStringImpl(c, length);
    r->_hash = hash;
    r->_inTable = true;
    
    _table[i] = r;
    ++_keyCount;
    
    if (_keyCount * 2 >= _tableSize)
        expand();
    
    return r;
}

DOMStringImpl *AtomicString::add(const QChar *s, int length)
{
    if (!s)
        return 0;

    if (length == 0)
        return DOMStringImpl::empty();
    
    if (!_table)
        expand();
    
    unsigned hash = DOMStringImpl::computeHash(s, length);
    
    int i = hash & _tableSizeMask;
#if DUMP_STATISTICS
    ++numProbes;
    numCollisions += _table[i] && !equal(_table[i], s, length);
#endif
    while (DOMStringImpl *key = _table[i]) {
        if (equal(key, s, length))
            return key;
        i = (i + 1) & _tableSizeMask;
    }
    
    DOMStringImpl *r = new DOMStringImpl(s, length);
    r->_hash = hash;
    r->_inTable = true;
    
    _table[i] = r;
    ++_keyCount;
    
    if (_keyCount * 2 >= _tableSize)
        expand();
    
    return r;
}

DOMStringImpl *AtomicString::add(DOMStringImpl *r)
{
    if (!r || r->_inTable)
        return r;

    if (r->l == 0)
        return DOMStringImpl::empty();
    
    if (!_table)
        expand();
    
    unsigned hash = r->hash();
    
    int i = hash & _tableSizeMask;
#if DUMP_STATISTICS
    ++numProbes;
    numCollisions += _table[i] && !equal(_table[i], r);
#endif
    while (DOMStringImpl *key = _table[i]) {
        if (equal(key, r)) {
            return key;
        }
        i = (i + 1) & _tableSizeMask;
    }

    r->_inTable = true;
    _table[i] = r;
    ++_keyCount;
    
    if (_keyCount * 2 >= _tableSize)
        expand();
    
    return r;
}

inline void AtomicString::insert(DOMStringImpl *key)
{
    unsigned hash = key->hash();
    
    int i = hash & _tableSizeMask;
#if DUMP_STATISTICS
    ++numProbes;
    numCollisions += _table[i] != 0;
#endif
    while (_table[i])
        i = (i + 1) & _tableSizeMask;
    
    _table[i] = key;
}

void AtomicString::remove(DOMStringImpl *r)
{
    unsigned hash = r->_hash;
    
    DOMStringImpl *key;
    
    int i = hash & _tableSizeMask;
#if DUMP_STATISTICS
    ++numProbes;
    numCollisions += _table[i] && equal(_table[i], r);
#endif
    while ((key = _table[i])) {
        if (key == r)
            break;
        i = (i + 1) & _tableSizeMask;
    }
    if (!key)
        return;
 
    _table[i] = 0;
    --_keyCount;
    
    if (_keyCount * 6 < _tableSize && _tableSize > _minTableSize) {
        shrink();
        return;
    }
    
    // Reinsert all the items to the right in the same cluster.
    while (1) {
        i = (i + 1) & _tableSizeMask;
        key = _table[i];
        if (!key)
            break;
        _table[i] = 0;
        insert(key);
    }
}

void AtomicString::expand()
{
    rehash(_tableSize == 0 ? _minTableSize : _tableSize * 2);
}

void AtomicString::shrink()
{
    rehash(_tableSize / 2);
}

void AtomicString::rehash(int newTableSize)
{
    int oldTableSize = _tableSize;
    DOMStringImpl **oldTable = _table;
    
    _tableSize = newTableSize;
    _tableSizeMask = newTableSize - 1;
    _table = (DOMStringImpl **)calloc(newTableSize, sizeof(DOMStringImpl *));
    
    for (int i = 0; i != oldTableSize; ++i)
        if (DOMStringImpl *key = oldTable[i])
            insert(key);
    
    free(oldTable);
}

// Global constants for property name strings.

#if !AVOID_STATIC_CONSTRUCTORS
    // Define an AtomicString in the normal way.
    #define DEFINE_GLOBAL(name, string) extern const AtomicString name ## Atom(string);

    const AtomicString nullAtom;
    const AtomicString emptyAtom("");
#else
    // Define an AtomicString-sized array of pointers to avoid static initialization.
    // Use an array of pointers instead of an array of char in case there is some alignment issue.
    #define DEFINE_GLOBAL(name, string) \
        void * name ## Atom[(sizeof(AtomicString) + sizeof(void *) - 1) / sizeof(void *)];

    DEFINE_GLOBAL(null, ignored)
    DEFINE_GLOBAL(empty, ignored)
#endif

#define CALL_DEFINE_GLOBAL(name) DEFINE_GLOBAL(name, #name)
KHTML_ATOMICSTRING_EACH_GLOBAL(CALL_DEFINE_GLOBAL)

void AtomicString::init()
{
#if AVOID_STATIC_CONSTRUCTORS
    static bool initialized;
    if (!initialized) {
        // Use placement new to initialize the globals.
        new (&nullAtom) AtomicString;
        new (&emptyAtom) AtomicString("");
        
        #define PLACEMENT_NEW_GLOBAL(name, string) new (&name ## PropertyName) AtomicString(string);
        #define CALL_PLACEMENT_NEW_GLOBAL(name) PLACEMENT_NEW_GLOBAL(name, #name)
        KHTML_ATOMICSTRING_EACH_GLOBAL(CALL_PLACEMENT_NEW_GLOBAL)
        initialized = true;
    }
#endif
}

bool operator==(const AtomicString &a, const DOMString &b)
{
    return a.domString() == b;    
}
   
bool equalsIgnoreCase(const AtomicString &as, const DOMString &bs)
{
    // returns true when equal, false otherwise (ignoring case)
    return !strcasecmp(as.domString(), bs);
}

bool equalsIgnoreCase(const AtomicString &as, const AtomicString &bs)
{
    // returns true when equal, false otherwise (ignoring case)
    if (as == bs)
        return true;
    return !strcasecmp(as.domString(), bs.domString());
}

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久精品国产免大香伊| 久久激情五月婷婷| 久久国产福利国产秒拍| 91农村精品一区二区在线| 日韩欧美国产午夜精品| 中文字幕一区二区三区不卡| 免费av成人在线| 精品视频在线免费| 亚洲私人影院在线观看| 美女视频一区二区| 欧美久久高跟鞋激| 一区二区三区在线视频免费| 激情五月婷婷综合网| 欧美三级在线视频| 亚洲日本va在线观看| 风流少妇一区二区| 精品三级在线看| 免费成人深夜小野草| 欧美日韩成人综合| 婷婷久久综合九色综合伊人色| 91视频www| 中文字幕一区二区三| 成人免费视频app| 国产亚洲美州欧州综合国| 韩国av一区二区三区四区 | 91精品国产综合久久国产大片| ...xxx性欧美| a亚洲天堂av| 亚洲色图清纯唯美| 色综合久久综合网97色综合| 自拍偷拍欧美精品| 91国偷自产一区二区使用方法| 亚洲精品伦理在线| 色欲综合视频天天天| 亚洲影院在线观看| 欧美日韩小视频| 日韩成人一区二区| 欧美精品一区二区精品网| 久久精工是国产品牌吗| 精品成人免费观看| 成人一区二区三区| 亚洲综合丁香婷婷六月香| 欧美日韩夫妻久久| 狠狠狠色丁香婷婷综合激情| 日韩欧美一区二区免费| 国产精品中文字幕日韩精品 | 亚洲精品久久久久久国产精华液| 国产成人免费在线| 亚洲欧洲制服丝袜| 欧美高清dvd| 久久精品国产一区二区三 | 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 国产精品亚洲一区二区三区妖精| wwwwxxxxx欧美| 成人av在线电影| 亚洲亚洲精品在线观看| 日韩视频免费观看高清在线视频| 激情小说欧美图片| 伊人夜夜躁av伊人久久| 日韩欧美在线观看一区二区三区| 国产精品一卡二| 亚洲一区中文在线| 337p日本欧洲亚洲大胆精品| 丰满白嫩尤物一区二区| 亚洲午夜精品一区二区三区他趣| 精品国产在天天线2019| 99这里都是精品| 麻豆成人在线观看| 一区二区三区四区五区视频在线观看 | 国产精品一线二线三线| 一片黄亚洲嫩模| 国产亚洲欧美色| 欧美三片在线视频观看| 国产成a人亚洲精| 日本女人一区二区三区| 国产精品免费丝袜| 欧美一区二区三区四区五区 | 欧美国产精品久久| 欧美精品三级日韩久久| av亚洲精华国产精华| 日韩制服丝袜先锋影音| ...xxx性欧美| 国产日韩精品一区二区三区| 欧美日韩精品系列| 91网站在线观看视频| 国产91精品一区二区| 日韩精品乱码免费| 亚洲大片精品永久免费| 国产精品久久一级| 精品久久久久久久久久久院品网 | 久久理论电影网| 日韩一区二区中文字幕| 欧美视频三区在线播放| 床上的激情91.| 久久国产精品无码网站| 日韩中文字幕亚洲一区二区va在线| 亚洲同性同志一二三专区| 久久久久久久久岛国免费| 欧美一级专区免费大片| 欧美高清视频在线高清观看mv色露露十八| 成人久久视频在线观看| 韩国一区二区视频| 精品一区二区三区久久| 久久激情综合网| 麻豆精品视频在线| 另类小说综合欧美亚洲| 美国三级日本三级久久99| 日韩精品久久理论片| 亚洲成人av中文| 日韩高清不卡一区二区三区| 亚洲午夜激情网站| 日本中文一区二区三区| 日韩影视精彩在线| 日本不卡中文字幕| 另类调教123区| 国产精品一二三区| 99视频有精品| 91免费观看视频| 欧美性高清videossexo| 欧美色倩网站大全免费| 欧美片在线播放| 日韩一区二区免费视频| 日韩三级.com| 久久在线免费观看| 国产精品护士白丝一区av| 中文字幕一区日韩精品欧美| 亚洲男人的天堂av| 天堂在线一区二区| 精品一区二区三区视频在线观看| 激情深爱一区二区| www..com久久爱| 欧美日韩一卡二卡三卡| 日韩欧美国产一二三区| 国产拍欧美日韩视频二区| 亚洲欧美在线高清| 亚洲18女电影在线观看| 老司机午夜精品| 成人av手机在线观看| 欧美三区在线观看| 久久久高清一区二区三区| 一区视频在线播放| 日韩av不卡一区二区| 国产精品一二二区| 欧美日韩一区二区三区免费看| 日韩欧美中文字幕一区| 欧美国产乱子伦| 亚洲成人免费看| 国产高清不卡二三区| 欧美性生活一区| 久久久久成人黄色影片| 亚洲一线二线三线视频| 国产福利一区在线观看| 在线视频中文字幕一区二区| 日韩丝袜美女视频| 亚洲欧美日韩小说| 激情伊人五月天久久综合| 欧美中文字幕一区二区三区 | 91精品国产一区二区三区香蕉| 久久久久国产精品麻豆| 亚洲国产日韩一级| 成人激情动漫在线观看| 日韩一区二区三区视频在线观看| 国产精品免费aⅴ片在线观看| 日韩福利电影在线观看| 91美女在线视频| 久久久久久久久蜜桃| 午夜av一区二区三区| 成人精品高清在线| 日韩精品在线一区二区| 一区二区视频在线| 国产不卡视频在线播放| 欧美一区二区三区四区视频| 亚洲九九爱视频| 国产大陆a不卡| 精品欧美一区二区三区精品久久| 亚洲一区二区三区免费视频| 99这里只有精品| 久久久久国产精品人| 久草在线在线精品观看| 欧美裸体一区二区三区| 伊人一区二区三区| 91论坛在线播放| 中文成人综合网| 国产成人自拍在线| 欧美大黄免费观看| 麻豆国产精品视频| 日韩你懂的在线播放| 亚洲午夜私人影院| 在线观看一区不卡| 有坂深雪av一区二区精品| 99国产精品久久久久久久久久久| 中文字幕成人在线观看| 国产精品影视网| 国产日韩精品久久久| 懂色一区二区三区免费观看| 国产农村妇女精品| 成人不卡免费av| 国产精品初高中害羞小美女文| 国产福利一区在线| 中文字幕一区二区三区四区不卡|