src/share/vm/classfile/sharedPathsMiscInfo.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/classfile

src/share/vm/classfile/sharedPathsMiscInfo.cpp

Print this page




  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "classfile/classLoader.hpp"
  27 #include "classfile/classLoaderData.inline.hpp"
  28 #include "classfile/sharedPathsMiscInfo.hpp"
  29 #include "logging/log.hpp"
  30 #include "memory/allocation.inline.hpp"
  31 #include "memory/metaspaceShared.hpp"

  32 #include "runtime/arguments.hpp"
  33 #include "utilities/ostream.hpp"
  34 
  35 void SharedPathsMiscInfo::add_path(const char* path, int type) {
  36   log_info(classpath)("type=%s ", type_name(type));
  37   ClassLoader::trace_class_path("add misc shared path ", path);
  38   write(path, strlen(path) + 1);
  39   write_jint(jint(type));
  40 }
  41 
  42 void SharedPathsMiscInfo::ensure_size(size_t needed_bytes) {
  43   assert(_allocated, "cannot modify buffer during validation.");
  44   int used = get_used_bytes();
  45   int target = used + int(needed_bytes);
  46   if (target > _buf_size) {
  47     _buf_size = _buf_size * 2 + (int)needed_bytes;
  48     _buf_start = REALLOC_C_HEAP_ARRAY(char, _buf_start, _buf_size, mtClass);
  49     _cur_ptr = _buf_start + used;
  50     _end_ptr = _buf_start + _buf_size;
  51   }




  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "classfile/classLoader.hpp"
  27 #include "classfile/classLoaderData.inline.hpp"
  28 #include "classfile/sharedPathsMiscInfo.hpp"
  29 #include "logging/log.hpp"
  30 #include "memory/allocation.inline.hpp"
  31 #include "memory/metaspaceShared.hpp"
  32 #include "memory/resourceArea.hpp"
  33 #include "runtime/arguments.hpp"
  34 #include "utilities/ostream.hpp"
  35 
  36 void SharedPathsMiscInfo::add_path(const char* path, int type) {
  37   log_info(classpath)("type=%s ", type_name(type));
  38   ClassLoader::trace_class_path("add misc shared path ", path);
  39   write(path, strlen(path) + 1);
  40   write_jint(jint(type));
  41 }
  42 
  43 void SharedPathsMiscInfo::ensure_size(size_t needed_bytes) {
  44   assert(_allocated, "cannot modify buffer during validation.");
  45   int used = get_used_bytes();
  46   int target = used + int(needed_bytes);
  47   if (target > _buf_size) {
  48     _buf_size = _buf_size * 2 + (int)needed_bytes;
  49     _buf_start = REALLOC_C_HEAP_ARRAY(char, _buf_start, _buf_size, mtClass);
  50     _cur_ptr = _buf_start + used;
  51     _end_ptr = _buf_start + _buf_size;
  52   }


src/share/vm/classfile/sharedPathsMiscInfo.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File