[m-users.] How to write stack-friendly mercury-code?
Julien Fischer
jfischer at opturion.com
Tue Mar 29 23:29:48 AEDT 2016
On Tue, 29 Mar 2016, Dirk Ziegemeyer wrote:
>> Am 29.03.2016 um 06:58 schrieb Julien Fischer <jfischer at opturion.com>:
>>
>>
>> On Mon, 28 Mar 2016, Paul Bone wrote:
>>
>>> + Increase the size of the stack.
>>>
>>> In low-level graces, like asm_fast, put MERCURY_OPTIONS="--detstack-size
>>> N" in your environment. Check the Mercury user's guide.
>>
>> For completeness:
>>
>> In high-level C grades, Mercury programs just use the normal C stack. On
>> Unix-like platforms on you can adjust this using ulimit. On Windows,
>> you can use mmc's '--cstack-reserve-size' option to set the stack size
>> at compile time. (Alternatively, if you have Microsoft's dev tools
>> installed you can use the editbin utility to modify the size.)
>
> Thank you for this hint.
>
> Invoking the MinGW-cross-compiler with
> mmc --make --optimize-constructor-last-call --cstack-reserve-size 8388608
>
> didn’t help and even slowed down the execution speed of the compiled application.
>
> Did I use a reasonable stack size?
Without knowing something of the program in question, it's impossible to
say.
Julien.
More information about the users
mailing list