Add a new "dumpn" pseudo-opcode that dumps N copies of the same value
to the stage buffer. It's basically the same as "dump" but much faster
when dumping the same value a lot of times, for example, when writing
initial values for large arrays.
On my Linux system the time it took to dump a 100000000 cell array went
down from 20 to 8 seconds in Release configuration, i.e. 2.5 times faster!
I haven't profiled further yet (Visual Studio 2017 profiler is broken,
gprof won't output anything (I'm probably doing it wrong), I might try
valgrind later).
1. 'stock' public (or public const) variables will be written to the file IF AND ONLY IF it has been used (read or write)
2. 'non-stock' public (or public const) variables will always be written to the file (whether or not it has been used)
3. public variables (or public const) NEVER ever trigger unused symbol warnings
This fixes a buffer overrun introduced by commit eba8474294c1c106dd6e4f62a73160798f16458d.
The crash happens in do_call() when a function name was longer than
the max. allowed (sNAMEMAX) because of the leading '.' (dot) inserted
in command().
--------- test code --------
#include <a_samp>
OverlyLongFunctionNameYouCantEvenBotherToRead() {
print("hey");
}
main() {
OverlyLongFunctionNameYouCantEvenBotherToRead();
}
----- end of test code -----
Make the assembler fail with a fatal error 104 "invalid assembler instruction"
if met an unknown instruction. It won't tell a correct line number though.
This fixes a bug where the compiler generated incorrect addresses for
functions in #emit code if they were defined after the point of use.
For example, you couldn't reliably get the address of a function with
"#emit CONST.pri XXX" unless you make sure that XXX is defined before
the function in which you have you are referencing it.
Now the resolution of the function's address is deferred until assembling
phase (as with CALL), and the assembler is guaranteed to see all symbols
with their final addresses. To distinguish between functions and numeric
operands I added a '.' (period) in front of function names for both #emit
and normal calls.
See also 5) here: http://forum.sa-mp.com/showthread.php?t=355877
--------- test code --------
#include <a_samp> // DO NOT REMOVE THIS
main() {
#emit const.pri foo
}
stock foo() {
printf("Hello, World!");
}
----- end of test code -----