File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed
Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 11{
22 "name" :" dbModITerm" ,
33 "needs_non_default_destructor" : " true" ,
4+ "assert_alignment_is_multiple_of" : 8 ,
45 "fields" :[
56 {
67 "name" :" _name" ,
Original file line number Diff line number Diff line change @@ -84,6 +84,10 @@ namespace odb {
8484
8585 _{{klass.name }}::_{{klass.name }}(_dbDatabase* db)
8686 {
87+ {% if klass.assert_alignment_is_multiple_of %}
88+ // For pointer tagging the bottom log_2({{klass.assert_alignment_is_multiple_of}}) bits.
89+ static_assert (alignof (_{{klass.name }}) % {{klass.assert_alignment_is_multiple_of }} == 0 );
90+ {% endif%}
8791 {% for field in klass.fields %}
8892 {% if field.bitFields %}
8993 {{field.name }} = {};
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ bool _dbModITerm::operator<(const _dbModITerm& rhs) const
5757
5858_dbModITerm::_dbModITerm (_dbDatabase* db)
5959{
60- // For pointer tagging the bottom 3 bits.
60+ // For pointer tagging the bottom log_2(8) bits.
6161 static_assert (alignof (_dbModITerm) % 8 == 0 );
6262 _name = nullptr ;
6363}
You can’t perform that action at this time.
0 commit comments