The MEMSYS5 algorithm does not have to return the block with the lowest
address. Any block of the appropriate size will do. Use the first block found on the freelist for the appropriate size for a performance improvement. FossilOrigin-Name: 12e612e8e7c4a6f83acf0daf5608151fb5ec1575
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
C Add\snewlines\sat\sthe\send\sof\ssome\serror\smessages\sin\sspeedtest1.
|
||||
D 2013-11-23T21:29:07.429
|
||||
C The\sMEMSYS5\salgorithm\sdoes\snot\shave\sto\sreturn\sthe\sblock\swith\sthe\slowest\naddress.\s\sAny\sblock\sof\sthe\sappropriate\ssize\swill\sdo.\s\sUse\sthe\sfirst\sblock\nfound\son\sthe\sfreelist\sfor\sthe\sappropriate\ssize\sfor\sa\sperformance\simprovement.
|
||||
D 2013-11-24T00:46:00.452
|
||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||
F Makefile.in e1a9b4258bbde53f5636f4e238c65b7e11459e2b
|
||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||
@@ -194,7 +194,7 @@ F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
|
||||
F src/mem1.c c0c990fcaddff810ea277b4fb5d9138603dd5d4b
|
||||
F src/mem2.c dce31758da87ec2cfa52ba4c5df1aed6e07d8e8f
|
||||
F src/mem3.c 61c9d47b792908c532ca3a62b999cf21795c6534
|
||||
F src/mem5.c 0025308a93838022bd5696cf9627ff4e40b19918
|
||||
F src/mem5.c 2221f7e4619619d2df16fcb8a1da2a165ae56d9d
|
||||
F src/memjournal.c 0683aac6cab6ec2b5374c0db37c0deb2436a3785
|
||||
F src/mutex.c d3b66a569368015e0fcb1ac15f81c119f504d3bc
|
||||
F src/mutex.h 5bc526e19dccc412b7ff04642f6fdad3fdfdabea
|
||||
@@ -1142,7 +1142,8 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
|
||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||
F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01
|
||||
F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff
|
||||
P 659f1a98ae698d062269f8fdac84f733a460f5de
|
||||
R 0d67753f14410df579db17c64fb3786e
|
||||
P 6b98f0af7a6522873245d30598d7c79b8aeb9fa0 8191b512122c13d7fa61d8e5487652f13ec172f7
|
||||
R c70b3f80a0897046826a17fb7011539e
|
||||
T +closed 8191b512122c13d7fa61d8e5487652f13ec172f7
|
||||
U drh
|
||||
Z 430a11d968198395db1db68b7169dc35
|
||||
Z dce60b90fb1ae6b64b6c8216e4da2c33
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
6b98f0af7a6522873245d30598d7c79b8aeb9fa0
|
||||
12e612e8e7c4a6f83acf0daf5608151fb5ec1575
|
||||
+2
-20
@@ -209,25 +209,6 @@ static int memsys5Size(void *p){
|
||||
return iSize;
|
||||
}
|
||||
|
||||
/*
|
||||
** Find the first entry on the freelist iLogsize. Unlink that
|
||||
** entry and return its index.
|
||||
*/
|
||||
static int memsys5UnlinkFirst(int iLogsize){
|
||||
int i;
|
||||
int iFirst;
|
||||
|
||||
assert( iLogsize>=0 && iLogsize<=LOGMAX );
|
||||
i = iFirst = mem5.aiFreelist[iLogsize];
|
||||
assert( iFirst>=0 );
|
||||
while( i>0 ){
|
||||
if( i<iFirst ) iFirst = i;
|
||||
i = MEM5LINK(i)->next;
|
||||
}
|
||||
memsys5Unlink(iFirst, iLogsize);
|
||||
return iFirst;
|
||||
}
|
||||
|
||||
/*
|
||||
** Return a block of memory of at least nBytes in size.
|
||||
** Return NULL if unable. Return NULL if nBytes==0.
|
||||
@@ -273,7 +254,8 @@ static void *memsys5MallocUnsafe(int nByte){
|
||||
sqlite3_log(SQLITE_NOMEM, "failed to allocate %u bytes", nByte);
|
||||
return 0;
|
||||
}
|
||||
i = memsys5UnlinkFirst(iBin);
|
||||
i = mem5.aiFreelist[iBin];
|
||||
memsys5Unlink(i, iBin);
|
||||
while( iBin>iLogsize ){
|
||||
int newSize;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user