aboutsummaryrefslogtreecommitdiff
path: root/src/os_common.h
diff options
context:
space:
mode:
authordanielk1977 <danielk1977@noemail.net>2006-01-13 11:22:07 +0000
committerdanielk1977 <danielk1977@noemail.net>2006-01-13 11:22:07 +0000
commit1fef7d5d3f925fdb052b7ee1a3998ebbdf20bf80 (patch)
tree07da2117a0fd3ce0a27fd42e0824394fd96e64e1 /src/os_common.h
parente725929686092f5450cfc7f2c27383fe0874a872 (diff)
downloadsqlite-1fef7d5d3f925fdb052b7ee1a3998ebbdf20bf80.tar.gz
sqlite-1fef7d5d3f925fdb052b7ee1a3998ebbdf20bf80.zip
Remove a few duplicate variable initializations in sqlite3BtreeCursor(). (CVS 2937)
FossilOrigin-Name: 5e46ec01ff3fe8654fc267efbb12d2d1b01c48aa
Diffstat (limited to 'src/os_common.h')
-rw-r--r--src/os_common.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/os_common.h b/src/os_common.h
index 08b53942d..50e869ed1 100644
--- a/src/os_common.h
+++ b/src/os_common.h
@@ -132,8 +132,16 @@ int sqlite3_open_file_count = 0;
** Implementation of the os level dynamic memory allocation interface in terms
** of the standard malloc(), realloc() and free() found in many operating
** systems. No rocket science here.
+**
+** There are two versions of these four functions here. The version
+** implemented here is only used if memory-management or memory-debugging is
+** enabled. This version allocates an extra 8-bytes at the beginning of each
+** block and stores the size of the allocation there.
+**
+** If neither memory-management or debugging is enabled, the second
+** set of implementations is used instead.
*/
-#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
+#if defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) || defined (SQLITE_MEMDEBUG)
void *sqlite3GenericMalloc(int n){
char *p = (char *)malloc(n+8);
assert(n>0);
@@ -173,7 +181,9 @@ void sqlite3GenericFree(void *p){
assert(p);
free(p);
}
+#if 0 /* Never actually invoked */
int sqlite3GenericAllocationSize(void *p){
assert(0);
}
#endif
+#endif