Rev 4690: Get Keys into the btree implementation. in http://bazaar.launchpad.net/~jameinel/bzr/2.1-memory-consumption
John Arbash Meinel
john at arbash-meinel.com
Wed Sep 9 22:03:05 BST 2009
At http://bazaar.launchpad.net/~jameinel/bzr/2.1-memory-consumption
------------------------------------------------------------
revno: 4690
revision-id: john at arbash-meinel.com-20090909210251-x22c3hj4uvaplxzu
parent: john at arbash-meinel.com-20090909210040-o4ar9chb9bjutqgw
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.1-memory-consumption
timestamp: Wed 2009-09-09 16:02:51 -0500
message:
Get Keys into the btree implementation.
At the moment, it is used for the ref-lists, rather than being
used for the keys themselves. This is because we don't have 'depth'
information, so we don't know that a given Keys instance should
be considered a singular Key.
I'll probably hack together 'depth' support, rather than have a
Key type, though either would be reasonable.
-------------- next part --------------
=== modified file 'bzrlib/_btree_serializer_pyx.pyx'
--- a/bzrlib/_btree_serializer_pyx.pyx 2009-09-04 21:16:14 +0000
+++ b/bzrlib/_btree_serializer_pyx.pyx 2009-09-09 21:02:51 +0000
@@ -94,6 +94,8 @@
Py_DECREF_ptr(py_str)
return result
+from bzrlib import _keys_type_c
+
cdef class BTreeLeafParser:
"""Parse the leaf nodes of a BTree index.
@@ -250,8 +252,9 @@
if temp_ptr == NULL:
# key runs to the end
temp_ptr = ref_ptr
- PyList_Append(ref_list, self.extract_key(temp_ptr))
- PyList_Append(ref_lists, tuple(ref_list))
+ ref_list.extend(self.extract_key(temp_ptr))
+ ref_list = _keys_type_c.Keys(self.key_length, *ref_list)
+ PyList_Append(ref_lists, ref_list)
# prepare for the next reference list
self._start = next_start
ref_lists = tuple(ref_lists)
More information about the bazaar-commits
mailing list