summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-10-02 22:39:10 +1000
committerAndrew Tridgell <tridge@samba.org>2009-10-02 22:39:10 +1000
commitdfafd58348278276e51f84fe0d9e04ad41c3ac3d (patch)
tree0ed7fb56790642cf8de685e81cd7cd6581d9c55e /source4/lib/ldb
parent81c193da0945ea2dd355590a121ec83d77a594bd (diff)
downloadsamba-dfafd58348278276e51f84fe0d9e04ad41c3ac3d.tar.gz
samba-dfafd58348278276e51f84fe0d9e04ad41c3ac3d.tar.bz2
samba-dfafd58348278276e51f84fe0d9e04ad41c3ac3d.zip
Revert "s4-ldb: overallocate idxptr to reduce memory fragmentation"
This reverts commit e7846f69cacdd0551fcd777a71bf833a2fc9ca2b.
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_index.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c
index 1acbc204f7..0b96e07a7d 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_index.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_index.c
@@ -70,10 +70,8 @@ static int ltdb_idxptr_add(struct ldb_module *module, const struct ldb_message *
{
void *data = ldb_module_get_private(module);
struct ltdb_private *ltdb = talloc_get_type(data, struct ltdb_private);
- /* we overallocate a bit to save on memory fragmentation */
- unsigned alloc_length = ((ltdb->idxptr->num_dns+1) + 16) & ~15;
ltdb->idxptr->dn_list = talloc_realloc(ltdb->idxptr, ltdb->idxptr->dn_list,
- struct TDB_DATA, alloc_length);
+ struct TDB_DATA, ltdb->idxptr->num_dns+1);
if (ltdb->idxptr->dn_list == NULL) {
ltdb->idxptr->num_dns = 0;
return LDB_ERR_OPERATIONS_ERROR;