Re: hasMemory

2016-06-10 Thread Mark Wieder
Richard Gaskin writes: > What's working well in LC Script should for the most part remain working > going forward, getting only better and ever more capable where LC > Builder can add things that may be needed. But where LC Builder isn't > necessary LC Script is fine by itself. My (somewhat

Re: hasMemory

2016-06-10 Thread Mark Waddingham
On 2016-06-10 18:46, Mark Wieder wrote: Since all modern operating systems will happily dish out virtual memory and swap things around, I agree that seeing if you can allocate a block of memory of a given size is somewhat less useful. What might be more useful, though, is determining whether sw

Re: hasMemory

2016-06-10 Thread Mark Wieder
Richard Gaskin writes: > The challenge, however, is that currently most xTalks, including > LiveCode, sometimes have difficulty reporting errors in low-memory > conditions. When bad enough, it can sometimes cause a crash before > we're able to check "the result" and apply any remedy. Yes, th

Re: hasMemory

2016-06-10 Thread Mark Wieder
Mark Waddingham writes: > As an addendum, Fraser just reminded that even this is entirely useless > on Linux. OK - 'flaky' was a bad choice of words here. Point taken. And yes, the replacement for the hasMemory function was actually just an afterthought. What I really was afte

Re: hasMemory

2016-06-10 Thread Richard Gaskin
Peter TB Brett wrote: > On 10/06/2016 16:31, Richard Gaskin wrote: > >> From time to time it's useful to know how much RAM may be available >> to an application, to make decisions about loading data. > > No, it isn't useful. Don't do this. > > At the very best, you'll have a Time-of-check-to-tim

Re: hasMemory

2016-06-10 Thread Peter TB Brett
On 10/06/2016 16:31, Richard Gaskin wrote: From time to time it's useful to know how much RAM may be available to an application, to make decisions about loading data. No, it isn't useful. Don't do this. At the very best, you'll have a Time-of-check-to-time-of-use error (i.e. you check a co

Re: hasMemory

2016-06-10 Thread Richard Gaskin
Mark Waddingham wrote: > On 2016-06-10 06:14, Mark Wieder wrote: >> Here's a working cross-platform replacement for the flaky built-in >> hasMemory function. > > The builtin 'hasMemory' function is not flaky - the question it asks > just has no meaning

Re: hasMemory

2016-06-10 Thread Richard Gaskin
Mark Wieder wrote: > After spending part of a day playing around with LCB, I'm concluding > it's really not worth the effort. I got all excited seeing some of > what Dar's been turning out, but I can't see there's anything to gain > by turning a working library into an extension, and a lot of was

Re: hasMemory

2016-06-10 Thread Mark Waddingham
On 2016-06-10 10:05, Mark Waddingham wrote: P.S. The 'hasMemory' function in LiveCode actually does the best it can do - it sees if it can allocate a contiguous block of memory of the size that has been requested (using malloc) and if that succeeds, it frees the block and returns

Re: hasMemory

2016-06-10 Thread Mark Waddingham
On 2016-06-10 06:14, Mark Wieder wrote: Here's a working cross-platform replacement for the flaky built-in hasMemory function. The builtin 'hasMemory' function is not flaky - the question it asks just has no meaning on modern operating systems (and should probably actu

hasMemory

2016-06-09 Thread Mark Wieder
x27;s a working cross-platform replacement for the flaky built-in hasMemory function. /** * Return the number of free bytes */ on mouseUp put freeMemory() && "bytes" into field 1 put cr & hasMem(200) after field 1 end mouseUp function hasMem pDesiredBytes retu

Re: Finding available memory without shell, how to use hasMemory() - Found word(s) list error in the Text body

2014-02-27 Thread Andrew Kluthe
gt; > > On Sun, Feb 23, 2014 at 9:09 PM, Mark Wieder > wrote: > > > >> Gabriel- > >> > >> Thursday, February 20, 2014, 11:07:59 AM, you wrote: > >> > >>> Hey All, > >> > >>> I am working on a program where I ne

Re: Finding available memory without shell, how to use hasMemory() - Found word(s) list error in the Text body

2014-02-27 Thread Bob Sneidar
on a program where I need to know the amount of available >>> memory. >> >>> I'm running on OS X and hasMemory() appears to return true/false for the >>> same values regardless changes to free/available memory. Is there some >>> trick to getting

Re: Finding available memory without shell, how to use hasMemory()

2014-02-26 Thread Thierry Douez
Gabriel, >> > I am working on a program where I need to know the amount of >> > available memory. You can shell this: sysctl - a | grep mem or sysctl hw.usermem or HTH, Thierry Thierry Douez - http://sunny-tdz.com Maker o

Re: Finding available memory without shell, how to use hasMemory()

2014-02-26 Thread Gabriel Johnson
Wieder wrote: > Gabriel- > > Thursday, February 20, 2014, 11:07:59 AM, you wrote: > > > Hey All, > > > I am working on a program where I need to know the amount of available > > memory. > > > I'm running on OS X and hasMemory() appears to return true/f

Re: Finding available memory without shell, how to use hasMemory()

2014-02-23 Thread Mark Wieder
Gabriel- Thursday, February 20, 2014, 11:07:59 AM, you wrote: > Hey All, > I am working on a program where I need to know the amount of available > memory. > I'm running on OS X and hasMemory() appears to return true/false for the > same values regardless changes to free/

Re: Finding available memory without shell, how to use hasMemory()

2014-02-20 Thread Richmond
On 20/02/14 21:07, Gabriel Johnson wrote: Hey All, I am working on a program where I need to know the amount of available memory. I'm running on OS X and hasMemory() appears to return true/false for the same values regardless changes to free/available memory. Is there some trick to ge

Finding available memory without shell, how to use hasMemory()

2014-02-20 Thread Gabriel Johnson
Hey All, I am working on a program where I need to know the amount of available memory. I'm running on OS X and hasMemory() appears to return true/false for the same values regardless changes to free/available memory. Is there some trick to getting hasMemory() to correspond with the a