Features of the mql5 language, subtleties and tricks - page 264

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
It's not quite clear here.
How much memory to allocate, how to calculate?
It's a strange picture.
I don't understand why first 8 and then 9.
I also don't understand why memory is expanded for the second time when the second parameter = 1000002 and not 1000001. And the third time at the second parameter = 2000003 and not at 2000001 or 2000002.
I also don't understand why the memory is expanded for the second time when the second parameter = 1000002 and not 1000001.
Forum on trading, automated trading systems and testing trading strategies
Peculiarities of mql5 language, subtleties and techniques of work
Nikolai Semko, 2024.06.06 01:49
Here the physical size is 1e6 + 1, not 1e6. That is, you have 1 element + 1e6 in reserve.
The reserve is enough up to and including 1000001.
I could be wrong, but most likely I'm not
Here the physical size is 1e6 + 1, not 1e6. That is, you have 1 element + 1e6 in reserve.
The reserve is enough up to and including 1000001.
I could be wrong, but I'm probably not wrong
you are wrong.
since the minimum step is 1 million, this experiment will be more correct:
now you can see that you are wrong
strange, why 76 Mb and not 80 ?!!strange, why 76 Mb and not 80 ?!
Forum on trading, automated trading systems and testing trading strategies
How to find out the reserved memory of a dynamic array?
Laszlo Tormasi, 2024.01.04 08:36 AM
Use MQLInfoInteger to get the memory used by the script directly instead of terminal memory used.
wrong
What's the difference between
и
?
Why should it work differently ?
hmm...
With uchar array, the picture is as follows (which is as plausible as possible):but now the picture is like this. Better, but still not clear why 77 and not 80
and with int the picture is as follows:
riddles
you are wrong.
since the minimum step is 1 million, this experiment will be more correct:
now you can see that you are wrong
strange, why 76 Mb and not 80 ?!!I don't know why for 1000001 and 1000002 you have the same now. I have everything as expected:
hmm...
but now the picture is like this. Better, but still not clear why 77 and not 80
And where are you launching from? Probably start_mem is not zero because there is something else in the programme besides the code you are publishing.
Type start_mem tooI don't know why for 1000001 and 1000002 you have the same now. It's as expected for me:
I think it is the work of MQLInfoInteger(MQL_MEMORY_USED) and TerminalInfoInteger(TERMINAL_MEMORY_USED) that is to blame.
Where are you launching from? Probably start_mem is not zero because there is something else in the programme besides the code you are publishing.
Type in start_mem too.I'm running from an empty script