[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: FontTableCache.cpp
File is not writable. Editing disabled.
/* ************************************************************************* * © 2016 and later: Unicode, Inc. and others. * License & terms of use: http://www.unicode.org/copyright.html#License ************************************************************************* ************************************************************************* * Copyright (C) 2003 - 2008, International Business Machines * Corporation and others. All Rights Reserved. ************************************************************************* */ #include "layout/LETypes.h" #include "FontTableCache.h" #define TABLE_CACHE_INIT 5 #define TABLE_CACHE_GROW 5 struct FontTableCacheEntry { LETag tag; const void *table; }; FontTableCache::FontTableCache() : fTableCacheCurr(0), fTableCacheSize(TABLE_CACHE_INIT) { fTableCache = LE_NEW_ARRAY(FontTableCacheEntry, fTableCacheSize); if (fTableCache == NULL) { fTableCacheSize = 0; return; } for (int i = 0; i < fTableCacheSize; i += 1) { fTableCache[i].tag = 0; fTableCache[i].table = NULL; } } FontTableCache::~FontTableCache() { for (int i = fTableCacheCurr - 1; i >= 0; i -= 1) { freeFontTable(fTableCache[i].table); fTableCache[i].tag = 0; fTableCache[i].table = NULL; } fTableCacheCurr = 0; LE_DELETE_ARRAY(fTableCache); fTableCache = NULL; } void FontTableCache::freeFontTable(const void *table) const { LE_DELETE_ARRAY(table); } const void *FontTableCache::find(LETag tableTag) const { for (int i = 0; i < fTableCacheCurr; i += 1) { if (fTableCache[i].tag == tableTag) { return fTableCache[i].table; } } const void *table = readFontTable(tableTag); ((FontTableCache *) this)->add(tableTag, table); return table; } void FontTableCache::add(LETag tableTag, const void *table) { if (fTableCacheCurr >= fTableCacheSize) { le_int32 newSize = fTableCacheSize + TABLE_CACHE_GROW; fTableCache = (FontTableCacheEntry *) LE_GROW_ARRAY(fTableCache, newSize); for (le_int32 i = fTableCacheSize; i < newSize; i += 1) { fTableCache[i].tag = 0; fTableCache[i].table = NULL; } fTableCacheSize = newSize; } fTableCache[fTableCacheCurr].tag = tableTag; fTableCache[fTableCacheCurr].table = table; fTableCacheCurr += 1; }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 691.05 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: N/A