File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -546,14 +546,25 @@ ruby_init_stack(volatile VALUE *addr)
546
546
#define CHECK_ERR (expr ) \
547
547
{if (!(expr)) {rb_bug("err: %lu - %s", GetLastError(), #expr);}}
548
548
549
+ COMPILER_WARNING_PUSH
550
+ #if defined(__GNUC__ )
551
+ COMPILER_WARNING_IGNORED (- Wmaybe - uninitialized )
552
+ #endif
553
+ static inline SIZE_T
554
+ query_memory_basic_info (PMEMORY_BASIC_INFORMATION mi )
555
+ {
556
+ return VirtualQuery (mi , mi , sizeof (* mi ));
557
+ }
558
+ COMPILER_WARNING_POP
559
+
549
560
static void
550
561
native_thread_init_stack (rb_thread_t * th )
551
562
{
552
563
MEMORY_BASIC_INFORMATION mi ;
553
564
char * base , * end ;
554
565
DWORD size , space ;
555
566
556
- CHECK_ERR (VirtualQuery (& mi , & mi , sizeof ( mi ) ));
567
+ CHECK_ERR (query_memory_basic_info (& mi ));
557
568
base = mi .AllocationBase ;
558
569
end = mi .BaseAddress ;
559
570
end += mi .RegionSize ;
You can’t perform that action at this time.
0 commit comments