src/hotspot/share/logging/logMessageBuffer.cpp
changeset 49177 eebf559c9e0d
parent 47216 71c04702a3d5
equal deleted inserted replaced
49176:f413e471a6ab 49177:eebf559c9e0d
     1 /*
     1 /*
     2  * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   108       }
   108       }
   109     }
   109     }
   110 
   110 
   111     va_list copy;
   111     va_list copy;
   112     va_copy(copy, args);
   112     va_copy(copy, args);
   113     written += (size_t)os::log_vsnprintf(current_buffer_position, remaining_buffer_length, fmt, copy) + 1;
   113     written += (size_t)os::vsnprintf(current_buffer_position, remaining_buffer_length, fmt, copy) + 1;
   114     va_end(copy);
   114     va_end(copy);
   115     if (written > _message_buffer_capacity - _message_buffer_size) {
   115     if (written > _message_buffer_capacity - _message_buffer_size) {
   116       assert(attempts == 0, "Second attempt should always have a sufficiently large buffer (resized to fit).");
   116       assert(attempts == 0, "Second attempt should always have a sufficiently large buffer (resized to fit).");
   117       grow(_message_buffer, _message_buffer_capacity, _message_buffer_size + written);
   117       grow(_message_buffer, _message_buffer_capacity, _message_buffer_size + written);
   118       continue;
   118       continue;