Skip to content

Commit 32eb582

Browse files
committed
Remove pointer indirection for BtrBulk::m_page_bulks
1 parent 4a456ea commit 32eb582

File tree

4 files changed

+17
-31
lines changed

4 files changed

+17
-31
lines changed

storage/innobase/btr/btr0bulk.cc

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -730,10 +730,10 @@ BtrBulk::logFreeCheck()
730730
void
731731
BtrBulk::release()
732732
{
733-
ut_ad(m_root_level + 1 == m_page_bulks->size());
733+
ut_ad(m_root_level + 1 == m_page_bulks.size());
734734

735735
for (ulint level = 0; level <= m_root_level; level++) {
736-
PageBulk* page_bulk = m_page_bulks->at(level);
736+
PageBulk* page_bulk = m_page_bulks.at(level);
737737

738738
page_bulk->release();
739739
}
@@ -743,10 +743,10 @@ BtrBulk::release()
743743
void
744744
BtrBulk::latch()
745745
{
746-
ut_ad(m_root_level + 1 == m_page_bulks->size());
746+
ut_ad(m_root_level + 1 == m_page_bulks.size());
747747

748748
for (ulint level = 0; level <= m_root_level; level++) {
749-
PageBulk* page_bulk = m_page_bulks->at(level);
749+
PageBulk* page_bulk = m_page_bulks.at(level);
750750
page_bulk->latch();
751751
}
752752
}
@@ -764,7 +764,7 @@ BtrBulk::insert(
764764
dberr_t err = DB_SUCCESS;
765765

766766
/* Check if we need to create a PageBulk for the level. */
767-
if (level + 1 > m_page_bulks->size()) {
767+
if (level + 1 > m_page_bulks.size()) {
768768
PageBulk* new_page_bulk
769769
= UT_NEW_NOKEY(PageBulk(m_index, m_trx_id, FIL_NULL,
770770
level, m_flush_observer));
@@ -773,16 +773,16 @@ BtrBulk::insert(
773773
return(err);
774774
}
775775

776-
m_page_bulks->push_back(new_page_bulk);
777-
ut_ad(level + 1 == m_page_bulks->size());
776+
m_page_bulks.push_back(new_page_bulk);
777+
ut_ad(level + 1 == m_page_bulks.size());
778778
m_root_level = level;
779779

780780
is_left_most = true;
781781
}
782782

783-
ut_ad(m_page_bulks->size() > level);
783+
ut_ad(m_page_bulks.size() > level);
784784

785-
PageBulk* page_bulk = m_page_bulks->at(level);
785+
PageBulk* page_bulk = m_page_bulks.at(level);
786786

787787
if (is_left_most && level > 0 && page_bulk->getRecNo() == 0) {
788788
/* The node pointer must be marked as the predefined minimum
@@ -838,7 +838,7 @@ BtrBulk::insert(
838838

839839
/* Set new page bulk to page_bulks. */
840840
ut_ad(sibling_page_bulk->getLevel() <= m_root_level);
841-
m_page_bulks->at(level) = sibling_page_bulk;
841+
m_page_bulks.at(level) = sibling_page_bulk;
842842

843843
UT_DELETE(page_bulk);
844844
page_bulk = sibling_page_bulk;
@@ -871,11 +871,11 @@ BtrBulk::insert(
871871
if (big_rec != NULL) {
872872
ut_ad(dict_index_is_clust(m_index));
873873
ut_ad(page_bulk->getLevel() == 0);
874-
ut_ad(page_bulk == m_page_bulks->at(0));
874+
ut_ad(page_bulk == m_page_bulks.at(0));
875875

876876
/* Release all latched but leaf node. */
877877
for (ulint level = 1; level <= m_root_level; level++) {
878-
PageBulk* page_bulk = m_page_bulks->at(level);
878+
PageBulk* page_bulk = m_page_bulks.at(level);
879879

880880
page_bulk->release();
881881
}
@@ -884,7 +884,7 @@ BtrBulk::insert(
884884

885885
/* Latch */
886886
for (ulint level = 1; level <= m_root_level; level++) {
887-
PageBulk* page_bulk = m_page_bulks->at(level);
887+
PageBulk* page_bulk = m_page_bulks.at(level);
888888
page_bulk->latch();
889889
}
890890
}
@@ -909,17 +909,17 @@ BtrBulk::finish(dberr_t err)
909909

910910
ut_ad(!dict_table_is_temporary(m_index->table));
911911

912-
if (m_page_bulks->size() == 0) {
912+
if (m_page_bulks.size() == 0) {
913913
/* The table is empty. The root page of the index tree
914914
is already in a consistent state. No need to flush. */
915915
return(err);
916916
}
917917

918-
ut_ad(m_root_level + 1 == m_page_bulks->size());
918+
ut_ad(m_root_level + 1 == m_page_bulks.size());
919919

920920
/* Finish all page bulks */
921921
for (ulint level = 0; level <= m_root_level; level++) {
922-
PageBulk* page_bulk = m_page_bulks->at(level);
922+
PageBulk* page_bulk = m_page_bulks.at(level);
923923

924924
last_page_no = page_bulk->getPageNo();
925925

storage/innobase/include/btr0bulk.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -292,20 +292,11 @@ class BtrBulk
292292
/** Destructor */
293293
~BtrBulk()
294294
{
295-
UT_DELETE(m_page_bulks);
296-
297295
#ifdef UNIV_DEBUG
298296
fil_space_dec_redo_skipped_count(m_index->space);
299297
#endif /* UNIV_DEBUG */
300298
}
301299

302-
/** Initialization
303-
Note: must be called right after constructor. */
304-
void init()
305-
{
306-
m_page_bulks = UT_NEW_NOKEY(page_bulk_vector());
307-
}
308-
309300
/** Insert a tuple
310301
@param[in] tuple tuple to insert.
311302
@return error code */
@@ -379,7 +370,7 @@ class BtrBulk
379370
FlushObserver* m_flush_observer;
380371

381372
/** Page cursor vector for all level */
382-
page_bulk_vector* m_page_bulks;
373+
page_bulk_vector m_page_bulks;
383374
};
384375

385376
#endif

storage/innobase/row/row0ftsort.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1689,7 +1689,6 @@ row_fts_merge_insert(
16891689

16901690
/* Create bulk load instance */
16911691
ins_ctx.btr_bulk = UT_NEW_NOKEY(BtrBulk(aux_index, trx->id, observer));
1692-
ins_ctx.btr_bulk->init();
16931692

16941693
/* Create tuple for insert */
16951694
ins_ctx.tuple = dtuple_create(heap, dict_index_get_n_fields(aux_index));

storage/innobase/row/row0merge.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2404,8 +2404,6 @@ row_merge_read_clustered_index(
24042404
BtrBulk(index[i],
24052405
trx->id,
24062406
observer));
2407-
2408-
clust_btr_bulk->init();
24092407
} else {
24102408
clust_btr_bulk->latch();
24112409
}
@@ -2519,7 +2517,6 @@ row_merge_read_clustered_index(
25192517

25202518
BtrBulk btr_bulk(index[i], trx->id,
25212519
observer);
2522-
btr_bulk.init();
25232520

25242521
err = row_merge_insert_index_tuples(
25252522
trx->id, index[i], old_table,
@@ -4888,7 +4885,6 @@ row_merge_build_indexes(
48884885
if (error == DB_SUCCESS) {
48894886
BtrBulk btr_bulk(sort_idx, trx->id,
48904887
flush_observer);
4891-
btr_bulk.init();
48924888

48934889
pct_cost = (COST_BUILD_INDEX_STATIC +
48944890
(total_dynamic_cost * merge_files[i].offset /

0 commit comments

Comments
 (0)