Re: pari_stackcheck_init using Win32 API
Bill Allombert <[email protected]> Fri, 30 Jan 2026 13:57:59 +0100
| Newsgroups | gmane.comp.mathematics.pari.devel |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Jan 28, 2026 at 04:00:00PM +0800, 管理员 wrote:
> void pari_stackcheck_init(void *pari_stack_base) {
> SYSTEM_INFO si;
> MEMORY_BASIC_INFORMATION mbi;
> ulong stack_size;
>
> if (!pari_stack_base) { PARI_stack_limit = NULL; return; }
>
> GetSystemInfo(&si);
> if (VirtualQuery(pari_stack_base, &mbi, sizeof(mbi)) != sizeof(mbi))
> stack_size = 1UL << 21;
> else
> stack_size = (ulong)pari_stack_base - (ulong)mbi.AllocationBase;
>
> PARI_stack_limit = (char*)mbi.AllocationBase + maxuu(stack_size >> 4, (ulong)(4 * si.dwPageSize));
> }
Thanks for your contribution !
Could you send this change as a patch instead ?
How do you write your name in english for the changelog ?
Cheers,
Bill.