diff options
author | Vasu Nori <vnori@google.com> | 2010-12-20 14:23:48 -0800 |
---|---|---|
committer | Vasu Nori <vnori@google.com> | 2010-12-20 14:23:48 -0800 |
commit | 5274e84e88d2cba20ad3cb21c55c1758b4da8af4 (patch) | |
tree | 3e5de42a2c88daf93578136684d265d0e3c3f54d /core/jni/android_database_SQLiteDatabase.cpp | |
parent | 6551a2d065b98acb2efa1834846b364b62dcd35f (diff) | |
download | frameworks_base-5274e84e88d2cba20ad3cb21c55c1758b4da8af4.zip frameworks_base-5274e84e88d2cba20ad3cb21c55c1758b4da8af4.tar.gz frameworks_base-5274e84e88d2cba20ad3cb21c55c1758b4da8af4.tar.bz2 |
Revert "bug:2448371 cursorwindow size moved to resource xml file."
This reverts commit 2594bae1f551d758c5c88771310d1ee3dc2c71ac.
Diffstat (limited to 'core/jni/android_database_SQLiteDatabase.cpp')
-rw-r--r-- | core/jni/android_database_SQLiteDatabase.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/core/jni/android_database_SQLiteDatabase.cpp b/core/jni/android_database_SQLiteDatabase.cpp index 9fd40c0..7aeed98 100644 --- a/core/jni/android_database_SQLiteDatabase.cpp +++ b/core/jni/android_database_SQLiteDatabase.cpp @@ -46,6 +46,7 @@ #define UTF16_STORAGE 0 #define INVALID_VERSION -1 +#define SQLITE_SOFT_HEAP_LIMIT (4 * 1024 * 1024) #define ANDROID_TABLE "android_metadata" /* uncomment the next line to force-enable logging of all statements */ // #define DB_LOG_STATEMENTS @@ -65,7 +66,6 @@ enum { static jfieldID offset_db_handle; static jmethodID method_custom_function_callback; static jclass string_class = NULL; -static jint sSqliteSoftHeapLimit = 0; static char *createStr(const char *path, short extra) { int len = strlen(path) + extra; @@ -129,7 +129,7 @@ static void dbopen(JNIEnv* env, jobject object, jstring pathString, jint flags) // The soft heap limit prevents the page cache allocations from growing // beyond the given limit, no matter what the max page cache sizes are // set to. The limit does not, as of 3.5.0, affect any other allocations. - sqlite3_soft_heap_limit(sSqliteSoftHeapLimit); + sqlite3_soft_heap_limit(SQLITE_SOFT_HEAP_LIMIT); // Set the default busy handler to retry for 1000ms and then return SQLITE_BUSY err = sqlite3_busy_timeout(handle, 1000 /* ms */); @@ -379,14 +379,10 @@ done: if (meta != NULL) sqlite3_free_table(meta); } -static void native_setSqliteSoftHeapLimit(JNIEnv* env, jobject object, jint limit) { - sSqliteSoftHeapLimit = limit; -} - static jint native_releaseMemory(JNIEnv *env, jobject clazz) { // Attempt to release as much memory from the - return sqlite3_release_memory(sSqliteSoftHeapLimit); + return sqlite3_release_memory(SQLITE_SOFT_HEAP_LIMIT); } static void native_finalize(JNIEnv* env, jobject object, jint statementId) @@ -470,7 +466,6 @@ static JNINativeMethod sMethods[] = {"enableSqlProfiling", "(Ljava/lang/String;S)V", (void *)enableSqlProfiling}, {"native_setLocale", "(Ljava/lang/String;I)V", (void *)native_setLocale}, {"native_getDbLookaside", "()I", (void *)native_getDbLookaside}, - {"native_setSqliteSoftHeapLimit", "(I)V", (void *)native_setSqliteSoftHeapLimit}, {"releaseMemory", "()I", (void *)native_releaseMemory}, {"native_finalize", "(I)V", (void *)native_finalize}, {"native_addCustomFunction", |