source: trunk/dports/databases/sqlite3/files/patch-sqlite3.c.diff @ 89249

Last change on this file since 89249 was 89249, checked in by ryandesign@…, 9 years ago

sqlite3: fix build on Tiger; see #32930

File size: 3.4 KB
  • sqlite3.c

    http://www.sqlite.org/src/info/238e35a441
    old new  
    1515115151** to obtain the memory it needs.
    1515215152**
    1515315153** This file contains implementations of the low-level memory allocation
    15154 ** routines specified in the sqlite3_mem_methods object.
     15154** routines specified in the sqlite3_mem_methods object.  The content of
     15155** this file is only used if SQLITE_SYSTEM_MALLOC is defined.  The
     15156** SQLITE_SYSTEM_MALLOC macro is defined automatically if neither the
     15157** SQLITE_MEMDEBUG nor the SQLITE_WIN32_MALLOC macros are defined.  The
     15158** default configuration is to use memory allocation routines in this
     15159** file.
     15160**
     15161** C-preprocessor macro summary:
     15162**
     15163**    HAVE_MALLOC_USABLE_SIZE     The configure script sets this symbol if
     15164**                                the malloc_usable_size() interface exists
     15165**                                on the target platform.  Or, this symbol
     15166**                                can be set manually, if desired.
     15167**                                If an equivalent interface exists by
     15168**                                a different name, using a separate -D
     15169**                                option to rename it.  This symbol will
     15170**                                be enabled automatically on windows
     15171**                                systems, and malloc_usable_size() will
     15172**                                be redefined to _msize(), unless the
     15173**                                SQLITE_WITHOUT_MSIZE macro is defined.
     15174**   
     15175**    SQLITE_WITHOUT_ZONEMALLOC   Some older macs lack support for the zone
     15176**                                memory allocator.  Set this symbol to enable
     15177**                                building on older macs.
     15178**
     15179**    SQLITE_WITHOUT_MSIZE        Set this symbol to disable the use of
     15180**                                _msize() on windows systems.  This might
     15181**                                be necessary when compiling for Delphi,
     15182**                                for example.
    1515515183*/
    1515615184
    1515715185/*
     
    1516215190#ifdef SQLITE_SYSTEM_MALLOC
    1516315191
    1516415192/*
    15165 ** Windows systems have malloc_usable_size() but it is called _msize()
     15193** Windows systems have malloc_usable_size() but it is called _msize().
     15194** The use of _msize() is automatic, but can be disabled by compiling
     15195** with -DSQLITE_WITHOUT_MSIZE
    1516615196*/
    15167 #if !defined(HAVE_MALLOC_USABLE_SIZE) && SQLITE_OS_WIN
     15197#if !defined(HAVE_MALLOC_USABLE_SIZE) && SQLITE_OS_WIN \
     15198      && !defined(SQLITE_WITHOUT_MSIZE)
    1516815199# define HAVE_MALLOC_USABLE_SIZE 1
    1516915200# define malloc_usable_size _msize
    1517015201#endif
    1517115202
    15172 #if defined(__APPLE__)
     15203#if defined(__APPLE__) && !defined(SQLITE_WITHOUT_ZONEMALLOC)
    1517315204
    1517415205/*
    15175 ** Use the zone allocator available on apple products
     15206** Use the zone allocator available on apple products unless the
     15207** SQLITE_WITHOUT_ZONEMALLOC symbol is defined.
    1517615208*/
    1517715209#include <sys/sysctl.h>
    1517815210#include <malloc/malloc.h>
     
    1518715219#else /* if not __APPLE__ */
    1518815220
    1518915221/*
    15190 ** Use standard C library malloc and free on non-Apple systems.
     15222** Use standard C library malloc and free on non-Apple systems. 
     15223** Also used by Apple systems if SQLITE_WITHOUT_ZONEMALLOC is defined.
    1519115224*/
    1519215225#define SQLITE_MALLOC(x)    malloc(x)
    1519315226#define SQLITE_FREE(x)      free(x)
     
    1531915352** Initialize this module.
    1532015353*/
    1532115354static int sqlite3MemInit(void *NotUsed){
    15322 #if defined(__APPLE__)
     15355#if defined(__APPLE__) && !defined(SQLITE_WITHOUT_ZONEMALLOC)
    1532315356  int cpuCount;
    1532415357  size_t len;
    1532515358  if( _sqliteZone_ ){
Note: See TracBrowser for help on using the repository browser.