-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid allocating buffer when printing log. #851
base: master
Are you sure you want to change the base?
Conversation
36770ac
to
9468af0
Compare
With small embedded systems couldn't this lead faster to a stack overflow? |
The size of verbose buffer on stack is Is it too large for embedded systems? /// Size used by verbose mode.
/// 20 (date) + 15 (host_name) + 10 (pid) + 10 (type)
/// + 4 (@) ... + ? (progname)
VERBOSE_LEN = 128, |
I now see that you replaced MAXVERBOSELOGMSGLEN with VERBOSE_LEN which is much smaller, was that the intent? |
Yes. I separate a line of log message into a prefix ( |
I find that
Please see also:
Am I right? |
@@ -19,6 +19,14 @@ | |||
|
|||
#include "ace/OS_Memory.h" | |||
|
|||
// The sprintf format needs to be different for Windows and POSIX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this part would be useful in ace_wchar.h or OS_NS_stdio.h since other callers of ACE_OS::snprintf may need it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mitza-oci Which name is better for it?
ACE_TEXT_FORMAT_SPECIFIER
ACE_STRING_FORMAT_SPECIFIER
ACE_STR_FORMAT_SPECIFIER
ACE_C_STRING_FORMAT_SPECIFIER
ACE_C_STR_FORMAT_SPECIFIER
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was added in #1907
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks I remembered correctly that there was a macro already, it was just not merged yet, thanks for linking Adam
627e2c7
to
095b109
Compare
095b109
to
71cbcb5
Compare
No description provided.