| 952 | } |
| 953 | } |
| 954 | int lazyDelete(int desiredPages) { |
| 955 | std::vector<int> clearBuffer(SERVER_KNOBS->CLEAR_BUFFER_SIZE); |
| 956 | clearBuffer[0] = 0; |
| 957 | |
| 958 | IntKeyCursor fc(db, db.freetable, true); |
| 959 | int pagesDeleted = 0; |
| 960 | db.checkError( |
| 961 | "BtreeLazyDelete", |
| 962 | sqlite3BtreeLazyDelete( |
| 963 | fc.cursor, &clearBuffer[0], &clearBuffer[0] + clearBuffer.size(), desiredPages, &pagesDeleted)); |
| 964 | return pagesDeleted; |
| 965 | } |
| 966 | |
| 967 | // Reads and reconstitutes kv fragments given cursor, an arena to allocate in, and a direction to move the cursor. |
| 968 | // getNext() returns the next KV pair, if there is one |
no test coverage detected