~ubuntu-branches/ubuntu/wily/octave/wily-proposed

« back to all changes in this revision

Viewing changes to doc/interpreter/octave.html/Function-Locking.html

  • Committer: Package Import Robot
  • Author(s): Sébastien Villemot
  • Date: 2014-03-10 17:32:29 UTC
  • mfrom: (1.2.6)
  • Revision ID: package-import@ubuntu.com-20140310173229-000oj77i9m6tjpvd
Tags: 3.8.1-1
* Imported Upstream version 3.8.1
  + libgui/src/main-window.cc: Fix problems with gui startup and focus issues
    (Closes: #738672)
  + scripts/pkg/private/fix_depends.m: Fix installing packages where
    dependency name contains '-' (Closes: #740984)
* debian/copyright: reflect upstream changes.
* octave.postinst: remove workaround for #681064 (package dir re-creation).
  (Closes: #681461)
* Remove patches applied upstream:
  + doc-compressed-info.diff
  + kfreebsd_tcgetattr.diff
  + octave-cli-manpage.diff
  + save-uint8-in-text-format.diff
* mkoctfile is now an executable binary instead of a shell script.
  + mkoctfile-mpi.diff: adapt for new format of mkoctfile.
  + d/control: add shlibs:Depends to liboctave-dev.
* Fix statement about the GUI in NEWS.Debian.
* debian/control: don't mention the FAQ in descriptions, it has been removed.
* Adapt to the fact that JIT is now disabled by default in ./configure script.
* Disable JIT on hurd-i386, LLVM not available there.

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
<p>As an example,
68
68
</p>
69
69
<div class="example">
70
 
<pre class="example">mlock (&quot;my_function&quot;);
 
70
<pre class="example">function my_function ()
 
71
  mlock ();
 
72
  &hellip;
71
73
</pre></div>
72
74
 
73
 
<p>prevents <code>my_function</code> from being removed from memory, even if
74
 
<code>clear</code> is called.  It is possible to determine if a function is
75
 
locked into memory with the <code>mislocked</code>, and to unlock a function
76
 
with <code>munlock</code>, which the following illustrates.
 
75
<p>prevents <code>my_function</code> from being removed from memory after it is
 
76
called, even if <code>clear</code> is called.  It is possible to determine if
 
77
a function is locked into memory with the <code>mislocked</code>, and to unlock
 
78
a function with <code>munlock</code>, which the following illustrates.
77
79
</p>
78
80
<div class="example">
79
 
<pre class="example">mlock (&quot;my_function&quot;);
 
81
<pre class="example">my_function ();
80
82
mislocked (&quot;my_function&quot;)
81
83
&rArr; ans = 1
82
84
munlock (&quot;my_function&quot;);
89
91
</p>
90
92
<div class="example">
91
93
<pre class="example">function count_calls ()
 
94
  mlock ();
92
95
  persistent calls = 0;
93
96
  printf (&quot;'count_calls' has been called %d times\n&quot;,
94
97
          ++calls);
95
98
endfunction
96
 
mlock (&quot;count_calls&quot;);
97
99
 
98
100
count_calls ();
99
101
-| 'count_calls' has been called 1 times
103
105
-| 'count_calls' has been called 2 times
104
106
</pre></div>
105
107
 
106
 
<p>It is, however, often inconvenient to lock a function from the prompt,
107
 
so it is also possible to lock a function from within its body.  This
108
 
is simply done by calling <code>mlock</code> from within the function.
109
 
</p>
110
 
<div class="example">
111
 
<pre class="example">function count_calls ()
112
 
  mlock ();
113
 
  persistent calls = 0;
114
 
  printf (&quot;'count_calls' has been called %d times\n&quot;,
115
 
          ++calls);
116
 
endfunction
117
 
</pre></div>
118
 
 
119
108
<p><code>mlock</code> might equally be used to prevent changes to a function from having
120
109
effect in Octave, though a similar effect can be had with the
121
110
<code>ignore_function_time_stamp</code> function.