Skip to content

Commit 82fd3cb

Browse files
Fix growth padding size for custom cursor window allocation
1 parent 1940376 commit 82fd3cb

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

android-database-sqlcipher/src/main/cpp/CursorWindow.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ CursorWindow::CursorWindow(size_t initialSize, size_t growthPaddingSize, size_t
3232
mGrowthPaddingSize = growthPaddingSize;
3333
mMaxSize = maxSize;
3434
LOG_WINDOW("CursorWindow::CursorWindow initialSize:%d growBySize:%d maxSize:%d",
35-
initialSize, growBySize, maxSize);
35+
initialSize, growthPaddingSize, maxSize);
3636
}
3737

3838
bool CursorWindow::initBuffer(bool localOnly)
@@ -43,8 +43,8 @@ bool CursorWindow::initBuffer(bool localOnly)
4343
mHeader = (window_header_t *) mData;
4444
mSize = mInitialSize;
4545
clear();
46-
LOG_WINDOW("Created CursorWindow with new MemoryDealer: mFreeOffset = %d, mSize = %d, mInitialSize = %d, mFixedAllocationSize = %d, mData = %p",
47-
mFreeOffset, mSize, mInitialSize, mFixedAllocationSize, mData);
46+
LOG_WINDOW("Created CursorWindow with new MemoryDealer: mFreeOffset = %d, mSize = %d, mInitialSize = %d, mGrowthPaddingSize = %d, mMaxSize = %d, mData = %p",
47+
mFreeOffset, mSize, mInitialSize, mGrowthPaddingSize, mMaxSize, mData);
4848
return true;
4949
}
5050
return false;

android-database-sqlcipher/src/main/java/net/sqlcipher/CursorWindow.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ public CursorWindow(boolean localWindow) {
6969
if(allocation == null){
7070
allocation = new DefaultCursorWindowAllocation();
7171
}
72+
Log.i(getClass().getSimpleName(), String.format("Calling native_init with initialAllocationSize:%d, growthPaddingSize:%d, maxAllocationSize:%d",
73+
allocation.getInitialAllocationSize(),
74+
allocation.getGrowthPaddingSize(),
75+
allocation.getMaxAllocationSize()));
7276
native_init(localWindow,
7377
allocation.getInitialAllocationSize(),
7478
allocation.getGrowthPaddingSize(),

android-database-sqlcipher/src/main/java/net/sqlcipher/CustomCursorWindowAllocation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public long getInitialAllocationSize() {
2121
}
2222

2323
public long getGrowthPaddingSize() {
24-
return initialAllocationSize;
24+
return growthPaddingSize;
2525
}
2626

2727
public long getMaxAllocationSize() {

0 commit comments

Comments
 (0)