src/hotspot/os/windows/os_windows.cpp
changeset 49349 7194eb9e8f19
parent 49317 d17b6a80ae08
child 49449 ef5d5d343e2a
equal deleted inserted replaced
49348:fde3feaaa4ed 49349:7194eb9e8f19
   359   size_t sz;
   359   size_t sz;
   360   MEMORY_BASIC_INFORMATION minfo;
   360   MEMORY_BASIC_INFORMATION minfo;
   361   VirtualQuery(&minfo, &minfo, sizeof(minfo));
   361   VirtualQuery(&minfo, &minfo, sizeof(minfo));
   362   sz = (size_t)os::current_stack_base() - (size_t)minfo.AllocationBase;
   362   sz = (size_t)os::current_stack_base() - (size_t)minfo.AllocationBase;
   363   return sz;
   363   return sz;
   364 }
       
   365 
       
   366 size_t os::committed_stack_size(address bottom, size_t size) {
       
   367   MEMORY_BASIC_INFORMATION minfo;
       
   368   address top = bottom + size;
       
   369   size_t committed_size = 0;
       
   370 
       
   371   while (committed_size < size) {
       
   372     // top is exclusive
       
   373     VirtualQuery(top - 1, &minfo, sizeof(minfo));
       
   374     if ((minfo.State & MEM_COMMIT) != 0) {
       
   375       committed_size += minfo.RegionSize;
       
   376       top -= minfo.RegionSize;
       
   377     } else {
       
   378       break;
       
   379     }
       
   380   }
       
   381 
       
   382   return MIN2(committed_size, size);
       
   383 }
   364 }
   384 
   365 
   385 struct tm* os::localtime_pd(const time_t* clock, struct tm* res) {
   366 struct tm* os::localtime_pd(const time_t* clock, struct tm* res) {
   386   const struct tm* time_struct_ptr = localtime(clock);
   367   const struct tm* time_struct_ptr = localtime(clock);
   387   if (time_struct_ptr != NULL) {
   368   if (time_struct_ptr != NULL) {