From c376a19890768f63842f4853f5c84bf9c9328b7e Mon Sep 17 00:00:00 2001 From: drh Date: Mon, 14 Jul 2008 12:30:54 +0000 Subject: [PATCH] Work around a bug in Borland C. Ticket #3216. (CVS 5406) FossilOrigin-Name: 2c24e50da6f6c19dee105823125157db73bdd515 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/malloc.c | 10 +++++++--- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index 4bfb67db06..28d06880f0 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sadditional\stypos\sin\scomments\swithin\slemon.\s\sTicket\s#3215.\s(CVS\s5405) -D 2008-07-14T12:27:52 +C Work\saround\sa\sbug\sin\sBorland\sC.\s\sTicket\s#3216.\s(CVS\s5406) +D 2008-07-14T12:30:54 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in a03f7cb4f7ad50bc53a788c6c544430e81f95de4 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -115,7 +115,7 @@ F src/journal.c cffd2cd214e58c0e99c3ff632b3bee6c7cbb260e F src/legacy.c 3626c71fb70912abec9a4312beba753a9ce800df F src/loadext.c ae0eed9fa96d74172d2a90ee63b5bc36d284295c F src/main.c 453d54b33799bfa0adfdf8a97a196521f9d9e962 -F src/malloc.c 226a532e9e371d1bb3de2553bdd1f9b600ef099c +F src/malloc.c 3c11d9c2f6b7d1c2a81384ce81bb2ccfe5f1e62a F src/md5.c 008216bbb5d34c6fbab5357aa68575ad8a31516a F src/mem1.c 8340fa5f969e9f9b9bdeb54106457a2003456d2b F src/mem2.c 0fc5bd6581c80f3ebd9d0cdf0f3f9c08826397ba @@ -605,7 +605,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P dc697c26668929c4eed5ab8cde6975125a7e66c7 -R 1732e578d6bf76381bd12e8772b890d1 +P 372147699585ca4bd11100983de924f63c5cfce5 +R 08f181f5901eba7c64b34324e5a525a7 U drh -Z 5e2dbbb9892e14a4a7c834028e8bd672 +Z 28b71e0d3f12110f499c903968949ac4 diff --git a/manifest.uuid b/manifest.uuid index df594337db..41136c7dfe 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -372147699585ca4bd11100983de924f63c5cfce5 \ No newline at end of file +2c24e50da6f6c19dee105823125157db73bdd515 \ No newline at end of file diff --git a/src/malloc.c b/src/malloc.c index 351a38ce37..ed2bbb3836 100644 --- a/src/malloc.c +++ b/src/malloc.c @@ -12,7 +12,7 @@ ** ** Memory allocation functions used throughout sqlite. ** -** $Id: malloc.c,v 1.26 2008/07/08 19:34:07 drh Exp $ +** $Id: malloc.c,v 1.27 2008/07/14 12:30:54 drh Exp $ */ #include "sqliteInt.h" #include @@ -150,8 +150,10 @@ void sqlite3MallocEnd(void){ */ sqlite3_int64 sqlite3_memory_used(void){ int n, mx; + sqlite3_int64 res; sqlite3_status(SQLITE_STATUS_MEMORY_USED, &n, &mx, 0); - return (sqlite3_int64)n; + res = (sqlite3_int64)n; /* Work around bug in Borland C. Ticket #3216 */ + return res; } /* @@ -161,8 +163,10 @@ sqlite3_int64 sqlite3_memory_used(void){ */ sqlite3_int64 sqlite3_memory_highwater(int resetFlag){ int n, mx; + sqlite3_int64 res; sqlite3_status(SQLITE_STATUS_MEMORY_USED, &n, &mx, resetFlag); - return (sqlite3_int64)mx; + res = (sqlite3_int64)n; /* Work around bug in Borland C. Ticket #3216 */ + return res; } /*