On Windows, the application stack (i.e. the stack of the main thread) is 1 MB.  On 64 bit Windows, our thread stack (THREAD_STACK_SIZE) is 2 MB, and the above calculation can overflow due to the location of the application stack.  This is why we do the calculation again for a 1 MB stack.
On Windows, the application stack (i.e. the stack of the main thread)
is 1 MB.  On 64 bit Windows, our thread stack (THREAD_STACK_SIZE) is 2
MB, and the above calculation can overflow due to the location of the
application stack.  This is why we do the calculation again for a 1 MB
stack.

Did somebody say HACK?

zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb