1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Proposed template preprocessor magic for activating mmap only on platforms

where we know it works.

FossilOrigin-Name: d96272f031102514b02bd839aac9e37618872200
This commit is contained in:
drh
2013-04-02 10:29:13 +00:00
parent 6d81449fc6
commit a3a2b3bdc0
3 changed files with 26 additions and 9 deletions

View File

@@ -210,6 +210,23 @@
/*
** Default maximum size of memory used by xFetch in the VFS.
*/
#ifndef SQLITE_DEFAULT_MMAP_LIMIT
# define SQLITE_DEFAULT_MMAP_LIMIT (256*1024*1024)
#ifdef __APPLE__
# include <TargetConditions.h>
# if defined(TARGET_OS_IPHONE)
# define SQLITE_DEFAULT_MMAP_LIMIT 0
# endif
#endif
#ifndef SQLITE_DEFAULT_MMAP_LIMIT
# if defined(__linux__) \
|| defined(_WIN32) \
|| (defined(__APPLE__) && defined(__MACH__) && !defined(TARGET_OS_IPHONE)) \
|| defined(__sun) \
|| defined(__DragonFly__) \
|| defined(__FreeBSD__) \
|| defined(__NetBSD__) \
|| defined(__OpenBSD__)
# define SQLITE_DEFAULT_MMAP_LIMIT (256*1024*1024)
# else
# define SQLITE_DEFAULT_MMAP_LIMIT 0
# endif
#endif