Skip to content

Commit 4e58c84

Browse files
author
Tom Cherry
committed
liblog: remove obsolete comment
The log_time struct satisfies all of the requirements for an implicitly created copy constructor to be present, so not defining one here does not have any real effect. We don't want to delete the copy constructor for the rationale given either; modern C++ favors passing small types by value instead of by reference as the compiler has more opportunity for optimization in that case. That's especially true here, where the size of this struct is the size of a pointer on 64 bit systems. Test: the copy constructor exists for log_time Change-Id: Id314ca7729f4b1ca02adb6c7f0ae759b22be2a5c
1 parent a5a107f commit 4e58c84

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

liblog/include/log/log_time.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@
3535

3636
extern "C" {
3737

38-
/*
39-
* NB: we did NOT define a copy constructor. This will result in structure
40-
* no longer being compatible with pass-by-value which is desired
41-
* efficient behavior. Also, pass-by-reference breaks C/C++ ABI.
42-
*/
4338
struct log_time {
4439
public:
4540
uint32_t tv_sec = 0; /* good to Feb 5 2106 */

0 commit comments

Comments
 (0)