Skip to content

Commit

Permalink
Bug#25048573: STD::MAP INSTANTIATIONS CAUSE STATIC ASSERT FAILURES ON…
Browse files Browse the repository at this point in the history
… FREEBSD 11

Problem: Some instantiations of std::map have discrepancies between
the value_type of the map and the value_type of the map's allocator.
On FreeBSD 11 this is detected by Clang, and an error is raised at
compilation time.

Fix: Specify the correct value_type for the allocators.

Also fix an unused variable warning in storage/innobase/os/os0file.cc.
  • Loading branch information
kahatlen authored and dr-m committed Apr 26, 2017
1 parent 8923f6b commit 9df0426
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion storage/innobase/buf/buf0buf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ typedef std::map<
const byte*,
buf_chunk_t*,
std::less<const byte*>,
ut_allocator<std::pair<const byte*, buf_chunk_t*> > >
ut_allocator<std::pair<const byte* const, buf_chunk_t*> > >
buf_pool_chunk_map_t;

static buf_pool_chunk_map_t* buf_chunk_map_reg;
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/dict/dict0stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ then we would store 5,7,10,11,12 in the array. */
typedef std::vector<ib_uint64_t, ut_allocator<ib_uint64_t> > boundaries_t;

/** Allocator type used for index_map_t. */
typedef ut_allocator<std::pair<const char*, dict_index_t*> >
typedef ut_allocator<std::pair<const char* const, dict_index_t*> >
index_map_t_allocator;

/** Auxiliary map used for sorting indexes by name in dict_stats_save(). */
Expand Down
6 changes: 3 additions & 3 deletions storage/innobase/sync/sync0debug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ struct LatchDebug {
os_thread_id_t,
Latches*,
os_thread_id_less,
ut_allocator<std::pair<const std::string, latch_meta_t> > >
ut_allocator<std::pair<const os_thread_id_t, Latches*> > >
ThreadMap;

/** Constructor */
Expand Down Expand Up @@ -425,7 +425,7 @@ struct LatchDebug {
latch_level_t,
std::string,
latch_level_less,
ut_allocator<std::pair<latch_level_t, std::string> > >
ut_allocator<std::pair<const latch_level_t, std::string> > >
Levels;

/** Mutex protecting the deadlock detector data structures. */
Expand Down Expand Up @@ -1717,7 +1717,7 @@ struct CreateTracker {
const void*,
File,
std::less<const void*>,
ut_allocator<std::pair<const void*, File> > >
ut_allocator<std::pair<const void* const, File> > >
Files;

typedef OSMutex Mutex;
Expand Down

0 comments on commit 9df0426

Please sign in to comment.