diff src/share/vm/runtime/os.hpp @ 2469:677234770800

7017193: Small memory leak in get_stack_bounds os::create_stack_guard_pages Summary: getline() returns -1 but still allocate memory for str Reviewed-by: dcubed, coleenp
author dsamersoff
date Wed, 30 Mar 2011 19:38:07 +0400
parents 23ae54207126
children 188c9a5d6a6d
line wrap: on
line diff
--- a/src/share/vm/runtime/os.hpp	Mon Mar 28 12:48:08 2011 +0200
+++ b/src/share/vm/runtime/os.hpp	Wed Mar 30 19:38:07 2011 +0400
@@ -658,6 +658,10 @@
   // Hook for os specific jvm options that we don't want to abort on seeing
   static bool obsolete_option(const JavaVMOption *option);
 
+  // Read file line by line. If line is longer than bsize,
+  // rest of line is skipped. Returns number of bytes read or -1 on EOF
+  static int get_line_chars(int fd, char *buf, const size_t bsize);
+
   // Platform dependent stuff
 #ifdef TARGET_OS_FAMILY_linux
 # include "os_linux.hpp"