⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 custombuild.html

📁 sqlite的帮助文档
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><title>Custom Builds Of SQLite 3.6</title><style type="text/css">body {    margin: auto;    font-family: "Verdana" "sans-serif";    padding: 8px 1%;}a { color: #45735f }a:visited { color: #734559 }.logo { position:absolute; margin:3px; }.tagline {  float:right;  text-align:right;  font-style:italic;  width:240px;  margin:12px;  margin-top:58px;}.toolbar {  font-variant: small-caps;  text-align: center;  line-height: 1.6em;  margin: 0;  padding:1px 8px;}.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }.toolbar a:visited { color: white; }.toolbar a:hover { color: #80a796; background: white; }.content    { margin: 5%; }.content dt { font-weight:bold; }.content dd { margin-bottom: 25px; margin-left:20%; }.content ul { padding:0px; padding-left: 15px; margin:0px; }/* rounded corners */.se  { background: url(images/se.png) 100% 100% no-repeat #80a796}.sw  { background: url(images/sw.png) 0% 100% no-repeat }.ne  { background: url(images/ne.png) 100% 0% no-repeat }.nw  { background: url(images/nw.png) 0% 0% no-repeat }</style><meta http-equiv="content-type" content="text/html; charset=UTF-8">  </head><body><div><!-- container div to satisfy validator --><a href="index.html"><img class="logo" src="images/SQLite.gif" alt="SQLite Logo" border="0"></a><div><!-- IE hack to prevent disappearing logo--></div><div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div><table width=100% style="clear:both"><tr><td>  <div class="se"><div class="sw"><div class="ne"><div class="nw">  <div class="toolbar">    <a href="about.html">About</a>    <a href="sitemap.html">Sitemap</a>    <a href="docs.html">Documentation</a>    <a href="download.html">Download</a>    <a href="copyright.html">License</a>    <a href="news.html">News</a>    <a href="http://www.sqlite.org/cvstrac/index">Developers</a>    <a href="support.html">Support</a>  </div></div></div></div></div></td></tr></table>  <h1 align="center">Custom Builds Of SQLite Version 3.6<br>or<br>Porting SQLite 3.6 To New Operating Systems Or Unusual Platforms</h1><h2>1.0 Introduction</h2><p>For most applications, the recommended method for buildingSQLite is to use <a href="amalgamation.html">the amalgamation</a> codefile, <b>sqlite3.c</b>, and its corresponding header file<b>sqlite3.h</b>.  The sqlite3.c code file should compile andrun on any Unix, Windows, OS/2, or Mac OS X system without any changesor special compiler options.  Most applications can simply includethe sqlite3.c file together with the other C code files that makeup the application, compile them all together, and have workingand well configured version of SQLite.</p><blockquote><i>Most applications work great with SQLite in itsdefault configuration and with no special compile-time configuration.Most developers should be able to completely ignore this documentand simply build SQLite from<a href="amalgamation.html">the amalgamation</a> without anyspecial knowledge and without taking any special actions.</i></blockquote><p>However, highly tuned and specializedapplications may want or need to replace some ofSQLite's built-in system interface with alternative implementationsmore suitable for the needs of the application.  SQLite is designedto be easily reconfigured at compile-time to meet the specificneeds of individual projects.  Among the compile-time configurationoptions for SQLite are these:</p><ul><li><p> Replace the built-in mutex subsystem with an alternative        implementation.  </p></li><li><p> Completely disable all mutexing for use in single-threaded        applications. </p></li><li><p> Reconfigure the memory allocation subsystem to use a memory        allocator other the malloc() implementation from the standard        library. </p></li><li><p> Realign the memory allocation subsystem so that it never calls        malloc() at all but instead satisfies all memory requests using        a fixed-size memory buffer assigned to SQLite at startup. </p></li><li><p> Replace the interface to the file system with an alternative        design.  In other words, override all of the system calls that        SQLite makes in order to talk to the disk with a completely different        set of system calls. </p></li><li><p> Override other operating system interfaces such as calls to obtain        Zulu or local time. </p></li></ul><p>Generally speaking, there are three separate subsystems withinSQLite that can be modified or overridden at compile-time.  Themutex subsystem is used to serialize access to SQLite resources thatare shared among threads.  The memory allocation subsystem is usedto allocate memory required by SQLite objects and for the databasecache.  Finally, the <a href="c3ref/vfs.html">Virtual File System</a> subsystem isused to provide a portable interface between SQLite and the underlyingoperating system and especially the file system.  We call these threesubsystems the "interface" subsystems of SQLite.</p><p>We emphasis that most applications are well-served by the built-in default implementations of the SQLite interface subsystems.Developers are encouraged to use thedefault built-in implementations whenever possibleand to build SQLite without any special compile-time options or parameters.However, some highly specialized applications may benefit fromsubstituting or modifying one or more of these built-in SQLiteinterface subsystems.Or, if SQLite is used on an operating system other thanUnix (Linux or Mac OS X), Windows (Win32 or WinCE), or OS/2 then noneof the interface subsystems that come built into SQLite will workand the application will need to provide alternative implementationssuitable for the target platform.</p><h2>2.0 Configuring Or Replacing The Mutex Subsystem</h2><p>In a multithreaded environment, SQLite uses mutexes to serializeaccess to shared resources.The mutex subsystem is only required for applications that accessSQLite from multiple threads.  For single-threaded applications, orapplications which only call SQLite from a single thread, the mutexsubsystem can be completely disabled by recompiling with the followingoption:</p><blockquote><pre>-DSQLITE_THREADSAFE=0</pre></blockquote><p>Mutexes are cheap but they are not free, so performance will be betterwhen mutexes are completely disabled.  The resulting library footprintwill also be a little smaller.  Disability the mutexes as compile-timeis a recommended optimization for applications were it makes sense.</p><p>When using SQLite as a shared library, an application can test to seewhether or not mutexes have been disabled using the<a href="c3ref/threadsafe.html">sqlite3_threadsafe()</a> API.  Applications that link against SQLite atrun-time and use SQLite from multiple threads should probably check thisAPI to make sure they did not accidently get linked against a version ofthe SQLite library that has its mutexes disabled.  Single-threadedapplications will, of course, work correctly regardless of whether ornot SQLite is configured to be threadsafe, though they will be a littlebit faster when using versions of SQLite with mutexes disabled.</p><p>SQLite mutexes can also be disabled at run-time using thethe <a href="c3ref/config.html">sqlite3_config()</a> interface.  To completely disable all mutexing,the application can invoke:</p>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -