Dirk Laurie on Mon, 01 Apr 2013 12:18:45 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Idiom: allocatemem in a script
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Idiom: allocatemem in a script
- From: Dirk Laurie <dirk.laurie@gmail.com>
- Date: Mon, 1 Apr 2013 12:18:38 +0200
- Delivery-date: Mon, 01 Apr 2013 12:18:45 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=2w4NCq7QB5yWZwqcmxeMUuWmrisFNQ+P79Gw7Uredzw=; b=s7j7yvDZ34L80h/8kJleewbHdJEs1/ND0HD8Fx8kE0m+/iruAQ1PFTC9dagkrfnU+O WSYzoSrrm2UAhYqHi57YKlsUxr1iJz3x4tFDpfdC9ve1Gvoz7mJ8k5nStA7T/zMwsIf3 HU1dpcR6xgNBq5Mb0rZ7wV7CVAGKc33Rhjgbw2/zDfprbeLz6B+1LDNOa30N2kkTg+v1 xa1ZrGEsRBcfmvH2eqCo+XS2cO10+dhjcGwkMyIVvGW2kPyQoYCoAkTFgzYe27bGT8Sm IpdhS5xV8eK8N6dSB+K426NBa/WplIMmb2nmaU5cA8pc0wMQ06D1TxsHTzpUPHNb1CGj W5+A==
If you have a script with `allocatemem` in it, the script
runs to completion if invoked by `gp myscript.gp`.
If invoked by `read("myscript.gp")` inside an interactive
session, it runs up to the first `allocatemem` and returns.
I've always thought of this behaviour as an undesirable
side effect of the implementation, but I have now come
to realize that it is a feature, not a bug.
It's a neat, clean way to separate the test code
in a module from the library code. So, even when
I don't need to change the stack size, I'm putting
`allocatemem` in from now on.