Mercurial > hg > graal-jvmci-8
diff src/share/vm/utilities/ostream.cpp @ 6275:957c266d8bc5
Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 21 Aug 2012 10:39:19 +0200 |
parents | 3d91d5d7b166 d2a62e0f25eb |
children | c38f13903fdf |
line wrap: on
line diff
--- a/src/share/vm/utilities/ostream.cpp Mon Aug 20 15:21:31 2012 +0200 +++ b/src/share/vm/utilities/ostream.cpp Tue Aug 21 10:39:19 2012 +0200 @@ -385,7 +385,7 @@ if (_file != NULL) { if (_need_close) fclose(_file); _file = NULL; - FREE_C_HEAP_ARRAY(char, _file_name); + FREE_C_HEAP_ARRAY(char, _file_name, mtInternal); _file_name = NULL; } } @@ -393,7 +393,7 @@ rotatingFileStream::rotatingFileStream(const char* file_name) { _cur_file_num = 0; _bytes_writen = 0L; - _file_name = NEW_C_HEAP_ARRAY(char, strlen(file_name)+10); + _file_name = NEW_C_HEAP_ARRAY(char, strlen(file_name)+10, mtInternal); jio_snprintf(_file_name, strlen(file_name)+10, "%s.%d", file_name, _cur_file_num); _file = fopen(_file_name, "w"); _need_close = true; @@ -402,7 +402,7 @@ rotatingFileStream::rotatingFileStream(const char* file_name, const char* opentype) { _cur_file_num = 0; _bytes_writen = 0L; - _file_name = NEW_C_HEAP_ARRAY(char, strlen(file_name)+10); + _file_name = NEW_C_HEAP_ARRAY(char, strlen(file_name)+10, mtInternal); jio_snprintf(_file_name, strlen(file_name)+10, "%s.%d", file_name, _cur_file_num); _file = fopen(_file_name, opentype); _need_close = true; @@ -525,7 +525,7 @@ } // Create big enough buffer. - char *buf = NEW_C_HEAP_ARRAY(char, buffer_length); + char *buf = NEW_C_HEAP_ARRAY(char, buffer_length, mtInternal); strcpy(buf, ""); if (force_directory != NULL) { @@ -550,7 +550,7 @@ // %%% Need a MutexLocker? const char* log_name = LogFile != NULL ? LogFile : "hotspot.log"; const char* try_name = make_log_name(log_name, NULL); - fileStream* file = new(ResourceObj::C_HEAP) fileStream(try_name); + fileStream* file = new(ResourceObj::C_HEAP, mtInternal) fileStream(try_name); if (!file->is_open()) { // Try again to open the file. char warnbuf[O_BUFLEN*2]; @@ -558,18 +558,18 @@ "Warning: Cannot open log file: %s\n", try_name); // Note: This feature is for maintainer use only. No need for L10N. jio_print(warnbuf); - FREE_C_HEAP_ARRAY(char, try_name); + FREE_C_HEAP_ARRAY(char, try_name, mtInternal); try_name = make_log_name("hs_pid%p.log", os::get_temp_directory()); jio_snprintf(warnbuf, sizeof(warnbuf), "Warning: Forcing option -XX:LogFile=%s\n", try_name); jio_print(warnbuf); delete file; - file = new(ResourceObj::C_HEAP) fileStream(try_name); - FREE_C_HEAP_ARRAY(char, try_name); + file = new(ResourceObj::C_HEAP, mtInternal) fileStream(try_name); + FREE_C_HEAP_ARRAY(char, try_name, mtInternal); } if (file->is_open()) { _log_file = file; - xmlStream* xs = new(ResourceObj::C_HEAP) xmlStream(file); + xmlStream* xs = new(ResourceObj::C_HEAP, mtInternal) xmlStream(file); _outer_xmlStream = xs; if (this == tty) xtty = xs; // Write XML header. @@ -818,7 +818,7 @@ void ostream_init() { if (defaultStream::instance == NULL) { - defaultStream::instance = new(ResourceObj::C_HEAP) defaultStream(); + defaultStream::instance = new(ResourceObj::C_HEAP, mtInternal) defaultStream(); tty = defaultStream::instance; // We want to ensure that time stamps in GC logs consider time 0 @@ -836,9 +836,9 @@ gclog_or_tty = tty; // default to tty if (Arguments::gc_log_filename() != NULL) { fileStream * gclog = UseGCLogFileRotation ? - new(ResourceObj::C_HEAP) + new(ResourceObj::C_HEAP, mtInternal) rotatingFileStream(Arguments::gc_log_filename()) : - new(ResourceObj::C_HEAP) + new(ResourceObj::C_HEAP, mtInternal) fileStream(Arguments::gc_log_filename()); if (gclog->is_open()) { // now we update the time stamp of the GC log to be synced up @@ -943,7 +943,7 @@ bufferedStream::bufferedStream(size_t initial_size, size_t bufmax) : outputStream() { buffer_length = initial_size; - buffer = NEW_C_HEAP_ARRAY(char, buffer_length); + buffer = NEW_C_HEAP_ARRAY(char, buffer_length, mtInternal); buffer_pos = 0; buffer_fixed = false; buffer_max = bufmax; @@ -974,7 +974,7 @@ if (end < buffer_length * 2) { end = buffer_length * 2; } - buffer = REALLOC_C_HEAP_ARRAY(char, buffer, end); + buffer = REALLOC_C_HEAP_ARRAY(char, buffer, end, mtInternal); buffer_length = end; } } @@ -992,7 +992,7 @@ bufferedStream::~bufferedStream() { if (!buffer_fixed) { - FREE_C_HEAP_ARRAY(char, buffer); + FREE_C_HEAP_ARRAY(char, buffer, mtInternal); } }