/ Check-in [2c24e50d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Work around a bug in Borland C. Ticket #3216. (CVS 5406)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2c24e50da6f6c19dee105823125157db73bdd515
User & Date: drh 2008-07-14 12:30:54
Context
2008-07-14
12:38
Fix a bug introduced by check-in (5406). Ticket #3216. (CVS 5407) check-in: 518a24aa user: drh tags: trunk
12:30
Work around a bug in Borland C. Ticket #3216. (CVS 5406) check-in: 2c24e50d user: drh tags: trunk
12:27
Fix additional typos in comments within lemon. Ticket #3215. (CVS 5405) check-in: 37214769 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/malloc.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   **
    13     13   ** Memory allocation functions used throughout sqlite.
    14     14   **
    15         -** $Id: malloc.c,v 1.26 2008/07/08 19:34:07 drh Exp $
           15  +** $Id: malloc.c,v 1.27 2008/07/14 12:30:54 drh Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   #include <stdarg.h>
    19     19   #include <ctype.h>
    20     20   
    21     21   /*
    22     22   ** This routine runs when the memory allocator sees that the
................................................................................
   146    146   }
   147    147   
   148    148   /*
   149    149   ** Return the amount of memory currently checked out.
   150    150   */
   151    151   sqlite3_int64 sqlite3_memory_used(void){
   152    152     int n, mx;
          153  +  sqlite3_int64 res;
   153    154     sqlite3_status(SQLITE_STATUS_MEMORY_USED, &n, &mx, 0);
   154         -  return (sqlite3_int64)n;
          155  +  res = (sqlite3_int64)n;  /* Work around bug in Borland C. Ticket #3216 */
          156  +  return res;
   155    157   }
   156    158   
   157    159   /*
   158    160   ** Return the maximum amount of memory that has ever been
   159    161   ** checked out since either the beginning of this process
   160    162   ** or since the most recent reset.
   161    163   */
   162    164   sqlite3_int64 sqlite3_memory_highwater(int resetFlag){
   163    165     int n, mx;
          166  +  sqlite3_int64 res;
   164    167     sqlite3_status(SQLITE_STATUS_MEMORY_USED, &n, &mx, resetFlag);
   165         -  return (sqlite3_int64)mx;
          168  +  res = (sqlite3_int64)n;  /* Work around bug in Borland C. Ticket #3216 */
          169  +  return res;
   166    170   }
   167    171   
   168    172   /*
   169    173   ** Change the alarm callback
   170    174   */
   171    175   int sqlite3_memory_alarm(
   172    176     void(*xCallback)(void *pArg, sqlite3_int64 used,int N),