mlock bug

Ben Abbott bpabbott at mac.com
Sun Feb 17 08:13:19 CST 2008


On Feb 17, 2008, at 6:51 AM, Sergei Steshenko wrote:

>
> --- Ben Abbott <bpabbott at mac.com> wrote:
>
>> "mlock" appears to not function for my installation.
>>
>> ---------------------------
>> function y = test_mlock (x)
>>   persistent s = 0
>>   mlock;
>>   if (nargin > 0)
>>     s = x;
>>   endif
>>   y = s;
>> endfunction
>> ---------------------------
>>
>> octave:1> test_mlock
>> ans = 0
>> octave:2> test_mlock(1)
>> ans =  1
>> octave:3> test_mlock
>> ans =  1
>> octave:4> clear all
>> octave:5> test_mlock
>> ans = 0
>> octave:6> ver
>> ----------------------------------------------------------------------
>> GNU Octave Version 3.0.0+
>> GNU Octave License: GNU General Public License
>> Operating System: Darwin 9.2.0 Darwin Kernel Version 9.2.0: Tue  
>> Feb  5
>> 16:13:22 PST 2008; root:xnu-1228.3.13~1/RELEASE_I386 i386
>> ----------------------------------------------------------------------
>>
>> Should not the answer to line 5 still be "1"?
>>
>> Ben> _______________________________________________
>> Bug-octave mailing list
>> Bug-octave at octave.org
>> https://www.cae.wisc.edu/mailman/listinfo/bug-octave
>>
>
> In my case it appears to work:
>
> "
> octave:1> function y = test_mlock (x)
>>  persistent s = 0
>>  mlock;
>>  if (nargin > 0)
>>    s = x;
>>  endif
>>  y = s;
>> endfunction
> octave:2> test_mlock
> ans = 0
> octave:3> test_mlock(1)
> ans =  1
> octave:4> test_mlock
> ans =  1
> octave:5> clear all
> octave:6> test_mlock
> ans =  1
> octave:7> ver
> ----------------------------------------------------------------------
> GNU Octave Version 3.0.0
> GNU Octave License: GNU General Public License
> Operating System: Linux 2.6.18.8-0.9-default #1 SMP Sun Feb 10  
> 22:48:05 UTC 2008 i686
> ----------------------------------------------------------------------
> octave:8>
> ".
>
> Regards,
>  Sergei.

ok ... my 3.0.0+ on Darwin-386i doesn't work, but 3.0.0 on Linux does.

I checked 3.0.0 on Darwin-PPC and it worked as well.

I'll try building the latest sources on my Intel mac and see what  
happens.

Ben




More information about the Bug-octave mailing list