Skip to content

Explicitly define kMaxBurst#522

Merged
changlan merged 1 commit into
NetSys:masterfrom
shwang:burst
Jun 15, 2017
Merged

Explicitly define kMaxBurst#522
changlan merged 1 commit into
NetSys:masterfrom
shwang:burst

Conversation

@shwang

@shwang shwang commented Jun 15, 2017

Copy link
Copy Markdown
Member

This is required for proper linking. Previously we were able to get away only with declaration (but without definition) of kMaxBurst, because a compiler optimization ignores this issue when kMaxBurst is used for array sizing.

This is required for proper linking. Previously we were able to
get away with not declaring kMaxBurst, because a compiler optimization
ignores this issue when kMaxBurst is used for array sizing.
@sangjinhan sangjinhan changed the title Explicitly declare kMaxBurst Explicitly define kMaxBurst Jun 15, 2017
@codecov

codecov Bot commented Jun 15, 2017

Copy link
Copy Markdown

Codecov Report

Merging #522 into master will decrease coverage by 2.91%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #522      +/-   ##
==========================================
- Coverage   67.48%   64.57%   -2.92%     
==========================================
  Files         198      198              
  Lines       12245    12246       +1     
==========================================
- Hits         8264     7908     -356     
- Misses       3981     4338     +357
Impacted Files Coverage Δ
core/packet.cc 34.64% <ø> (ø) ⬆️
core/modules/port_inc.h 0% <0%> (-100%) ⬇️
core/modules/bpf.h 0% <0%> (-100%) ⬇️
core/modules/buffer.h 0% <0%> (-100%) ⬇️
core/modules/ether_encap.h 0% <0%> (-100%) ⬇️
core/modules/buffer.cc 4.34% <0%> (-95.66%) ⬇️
core/modules/ether_encap.cc 4.16% <0%> (-91.67%) ⬇️
core/modules/port_inc.cc 4.47% <0%> (-67.17%) ⬇️
core/modules/bpf.cc 0.72% <0%> (-52.79%) ⬇️
core/pktbatch.h 75% <0%> (-12.5%) ⬇️
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc93423...69fe05d. Read the comment docs.

@changlan
changlan merged commit 6ae2c56 into NetSys:master Jun 15, 2017
@changlan

Copy link
Copy Markdown
Member

image

@shwang
shwang deleted the burst branch June 15, 2017 23:59
natexornate added a commit to natexornate/bess that referenced this pull request Feb 7, 2022
kMaxBurst was declared and assigned a value, but not explicitly defined. This can cause issues when linking in cases where a reference
may be taken of kMaxBurst (say, passing it to std::min()) and the constant can't be fully optimized out.

This was actually fixed years ago in NetSys#522 but ended up being reverted accidentally during a refactor in NetSys#820.

With C++17 now, we don't have to put the definition in a source file, we can just add inline and that takes care of it.
gab-arrobo referenced this pull request in omec-project/bess Jan 9, 2024
* Ensure that kMaxBurst is explicitly defined

kMaxBurst was declared and assigned a value, but not explicitly defined. This can cause issues when linking in cases where a reference
may be taken of kMaxBurst (say, passing it to std::min()) and the constant can't be fully optimized out.

This was actually fixed years ago in #522 but ended up being reverted accidentally during a refactor in #820.

With C++17 now, we don't have to put the definition in a source file, we can just add inline and that takes care of it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants