Line
Link Here
|
0 |
-- src/rowset.c |
0 |
++ src/rowset.c |
Lines 60-66
Link Here
|
60 |
** There is an added cost of O(N) when switching between TEST and |
60 |
** There is an added cost of O(N) when switching between TEST and |
61 |
** SMALLEST primitives. |
61 |
** SMALLEST primitives. |
62 |
** |
62 |
** |
63 |
** $Id: rowset.c,v 1.6 2009/04/22 15:32:59 drh Exp $ |
63 |
** $Id: rowset.c,v 1.7 2009/05/22 01:00:13 drh Exp $ |
64 |
*/ |
64 |
*/ |
65 |
#include "sqliteInt.h" |
65 |
#include "sqliteInt.h" |
66 |
|
66 |
|
Lines 127-141
Link Here
|
127 |
*/ |
127 |
*/ |
128 |
RowSet *sqlite3RowSetInit(sqlite3 *db, void *pSpace, unsigned int N){ |
128 |
RowSet *sqlite3RowSetInit(sqlite3 *db, void *pSpace, unsigned int N){ |
129 |
RowSet *p; |
129 |
RowSet *p; |
130 |
assert( N >= sizeof(*p) ); |
130 |
assert( N >= ROUND8(sizeof(*p)) ); |
131 |
p = pSpace; |
131 |
p = pSpace; |
132 |
p->pChunk = 0; |
132 |
p->pChunk = 0; |
133 |
p->db = db; |
133 |
p->db = db; |
134 |
p->pEntry = 0; |
134 |
p->pEntry = 0; |
135 |
p->pLast = 0; |
135 |
p->pLast = 0; |
136 |
p->pTree = 0; |
136 |
p->pTree = 0; |
137 |
p->pFresh = (struct RowSetEntry*)&p[1]; |
137 |
p->pFresh = (struct RowSetEntry*)(ROUND8(sizeof(*p)) + (char*)p); |
138 |
p->nFresh = (u16)((N - sizeof(*p))/sizeof(struct RowSetEntry)); |
138 |
p->nFresh = (u16)((N - ROUND8(sizeof(*p)))/sizeof(struct RowSetEntry)); |
139 |
p->isSorted = 1; |
139 |
p->isSorted = 1; |
140 |
p->iBatch = 0; |
140 |
p->iBatch = 0; |
141 |
return p; |
141 |
return p; |