diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-10-02 22:39:10 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-10-02 22:39:10 +1000 |
commit | dfafd58348278276e51f84fe0d9e04ad41c3ac3d (patch) | |
tree | 0ed7fb56790642cf8de685e81cd7cd6581d9c55e | |
parent | 81c193da0945ea2dd355590a121ec83d77a594bd (diff) | |
download | samba-dfafd58348278276e51f84fe0d9e04ad41c3ac3d.tar.gz samba-dfafd58348278276e51f84fe0d9e04ad41c3ac3d.tar.bz2 samba-dfafd58348278276e51f84fe0d9e04ad41c3ac3d.zip |
Revert "s4-ldb: overallocate idxptr to reduce memory fragmentation"
This reverts commit e7846f69cacdd0551fcd777a71bf833a2fc9ca2b.
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_index.c | 4 |
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; |