mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 13:50:40 +01:00

Concatenating __FILE__ with __LINE__ prevents the compiler from aliasing strings within the same file, contributing ~30KB of .text bloat. Chrome already omits from the file number from its Location type so it doesn't seem to be a big loss. Bug: b/145168048 Change-Id: I000bfdf43f4eb90f8b63ed017b08c1b5a7a84a6d Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160744 Commit-Queue: Steve Anton <steveanton@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29994}
24 lines
669 B
C++
24 lines
669 B
C++
/*
|
|
* Copyright 2016 The WebRTC Project Authors. All rights reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#include "rtc_base/location.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
namespace rtc {
|
|
|
|
std::string Location::ToString() const {
|
|
char buf[256];
|
|
snprintf(buf, sizeof(buf), "%s@%s:%d", function_name_, file_name_,
|
|
line_number_);
|
|
return buf;
|
|
}
|
|
|
|
} // namespace rtc
|