`
deepfuture
  • 浏览: 4333184 次
  • 性别: Icon_minigender_1
  • 来自: 湛江
博客专栏
073ec2a9-85b7-3ebf-a3bb-c6361e6c6f64
SQLite源码剖析
浏览量:79421
1591c4b8-62f1-3d3e-9551-25c77465da96
WIN32汇编语言学习应用...
浏览量:68373
F5390db6-59dd-338f-ba18-4e93943ff06a
神奇的perl
浏览量:101495
Dac44363-8a80-3836-99aa-f7b7780fa6e2
lucene等搜索引擎解析...
浏览量:281185
Ec49a563-4109-3c69-9c83-8f6d068ba113
深入lucene3.5源码...
浏览量:14604
9b99bfc2-19c2-3346-9100-7f8879c731ce
VB.NET并行与分布式编...
浏览量:65559
B1db2af3-06b3-35bb-ac08-59ff2d1324b4
silverlight 5...
浏览量:31318
4a56b548-ab3d-35af-a984-e0781d142c23
算法下午茶系列
浏览量:45206
社区版块
存档分类
最新评论

SQLITE源码剖析(3)

阅读更多

 声明:本SQLite源码剖析系列为刘兴(http://deepfuture.iteye.com/)原创,未经笔者授权,任何人和机构不能转载

/*

** The SQLITE_DEFAULT_MEMSTATUS macro must be defined as either 0 or 1.

** It determines whether or not the features related to 

** SQLITE_CONFIG_MEMSTATUS are available by default or not. This value can

** be overridden at runtime using the sqlite3_config() API.

*/

// SQLITE_DEFAULT_MEMSTATUS宏被定义为0或1,在运行时可使

//用sqlite3_config() API修改该值

#if !defined(SQLITE_DEFAULT_MEMSTATUS)

# define SQLITE_DEFAULT_MEMSTATUS 1

#endif

 

/*

** Exactly one of the following macros must be defined in order to

** specify which memory allocation subsystem to use.

**该宏不一定要被定义,使用SQLITE_SYSTEM_MALLOC标准内存分配系统malloc()还是malloc()的SQLITE_MEMDEBUG调试版本

**     SQLITE_SYSTEM_MALLOC          // Use normal system malloc()

**     SQLITE_MEMDEBUG               // Debugging version of system malloc()

**

** (Historical note:  There used to be several other options, but we've

** pared it down to just these two.)

**

** If none of the above are defined, then set SQLITE_SYSTEM_MALLOC as

** the default.

*/

//SQLITE_SYSTEM_MALLOC和SQLITE_MEMDEBUG不能同时被定义

#if defined(SQLITE_SYSTEM_MALLOC)+defined(SQLITE_MEMDEBUG)>1

# error "At most one of the following compile-time configuration options\

 is allows: SQLITE_SYSTEM_MALLOC, SQLITE_MEMDEBUG"

#endif

//默认使用SQLITE_SYSTEM_MALLOC标准

#if defined(SQLITE_SYSTEM_MALLOC)+defined(SQLITE_MEMDEBUG)==0

# define SQLITE_SYSTEM_MALLOC 1

#endif

 

/*

** If SQLITE_MALLOC_SOFT_LIMIT is not zero, then try to keep the

** sizes of memory allocations below this value where possible.

*/

// SQLITE_MALLOC_SOFT_LIMIT非0,则试图把分配的内存控制在这些值以内

#if !defined(SQLITE_MALLOC_SOFT_LIMIT)

# define SQLITE_MALLOC_SOFT_LIMIT 1024

#endif

 

/*

** We need to define _XOPEN_SOURCE as follows in order to enable

** recursive mutexes on most Unix systems.  But Mac OS X is different.

** The _XOPEN_SOURCE define causes problems for Mac OS X we are told,

** so it is omitted there.  See ticket #2673.

**,

** Later we learn that _XOPEN_SOURCE is poorly or incorrectly

** implemented on some systems.  So we avoid defining it at all

** if it is already defined or if it is unneeded because we are

** not doing a threadsafe build.  Ticket #2681.

**

** See also ticket #2741.

*/

//在大多数UNIX系统中,我们需要定义_XOPEN_SOURCE允许递归互斥

//对于Mac OS X, _XOPEN_SOURCE导致一些问题发生

#if !defined(_XOPEN_SOURCE) && !defined(__DARWIN__) && !defined(__APPLE__) && SQLITE_THREADSAFE

#  define _XOPEN_SOURCE 500  /* Needed to enable pthread recursive mutexes */

#endif

 

/*

** The TCL headers are only needed when compiling the TCL bindings.

**TCL(Tool   Command   Language)是一种解释执行的脚本语言。具有良好的跨平台特性和**可扩展性,TCL本身是用C语言实现的,可以很方便的通过C语言进行扩充,增加新的**命令,也可以很方便的把TCL解释器嵌入你的程序中。TCL解释器也是公开源代码的。

**当编译TCL绑定时,才需要TCL头文件

*/

//如果需要绑定TCL,则包括tcl.h

#if defined(SQLITE_TCL) || defined(TCLSH)

# include <tcl.h>

#endif

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics