/ Check-in [4de5c529]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Fix compilation error when neither MEMDEBUG or ENABLE_MEMORY_MANAGEMENT is enabled. (CVS 2971)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4de5c52920c94e2a29ef4b68eb8b990c63005b3d
User & Date: danielk1977 2006-01-18 15:39:26
Context
2006-01-18
16:51
Use a global variable protected by a mutex instead of thread-specific-data to record malloc() failures. (CVS 2972) check-in: ac090f2a user: danielk1977 tags: trunk
15:39
Fix compilation error when neither MEMDEBUG or ENABLE_MEMORY_MANAGEMENT is enabled. (CVS 2971) check-in: 4de5c529 user: danielk1977 tags: trunk
15:25
Change sqlite3MallocClearFailed() calls to sqlite3ApiExit(), a better API. (CVS 2970) check-in: e0b022e5 user: danielk1977 tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/util.c.

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
...
643
644
645
646
647
648
649

650
651
652

653
654
655
656
657
658
659
**
*************************************************************************
** Utility functions used throughout sqlite.
**
** This file contains functions for allocating memory, comparing
** strings, and stuff like that.
**
** $Id: util.c,v 1.174 2006/01/18 15:25:18 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "os.h"
#include <stdarg.h>
#include <ctype.h>

/*
................................................................................
** sqlite3Malloc(), sqlite3Realloc() or sqlite3ReallocOrFree().
**
** The number of bytes allocated does not include any overhead inserted by 
** any malloc() wrapper functions that may be called. So the value returned
** is the number of bytes that were available to SQLite using pointer p, 
** regardless of how much memory was actually allocated.
*/

int sqlite3AllocSize(void *p){
  return OSSIZEOF(p);
}


/*
** Make a copy of a string in memory obtained from sqliteMalloc(). These 
** functions call sqlite3MallocRaw() directly instead of sqliteMalloc(). This
** is because when memory debugging is turned on, these two functions are 
** called via macros that record the current file and line number in the
** ThreadData structure.







|







 







>



>







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
...
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
**
*************************************************************************
** Utility functions used throughout sqlite.
**
** This file contains functions for allocating memory, comparing
** strings, and stuff like that.
**
** $Id: util.c,v 1.175 2006/01/18 15:39:26 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "os.h"
#include <stdarg.h>
#include <ctype.h>

/*
................................................................................
** sqlite3Malloc(), sqlite3Realloc() or sqlite3ReallocOrFree().
**
** The number of bytes allocated does not include any overhead inserted by 
** any malloc() wrapper functions that may be called. So the value returned
** is the number of bytes that were available to SQLite using pointer p, 
** regardless of how much memory was actually allocated.
*/
#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
int sqlite3AllocSize(void *p){
  return OSSIZEOF(p);
}
#endif

/*
** Make a copy of a string in memory obtained from sqliteMalloc(). These 
** functions call sqlite3MallocRaw() directly instead of sqliteMalloc(). This
** is because when memory debugging is turned on, these two functions are 
** called via macros that record the current file and line number in the
** ThreadData structure.