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 after is what the OS

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 on modern operating systems (and should prob

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 true. This shoul

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 actually be removed!). For