Restored from previous forum. Originally posted by tinman.
A couple of options that could be applied on a per-procedure basis:
No zero initialisation - does not initialise all the local variables to ero before the user code starts. String variables might still need to be zeroed.
No stack frame - PureBasic does not do any manipulation of the stack for storing local variables (might be useful for ASM coders?)
--
I used to be a nihilist but I don't believe in that any more.
(Win98first ed. + all updates, PB3.62, external editor)
Procedure options
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by tinman.
The only reason I thought of this was when I was looking at the created assembly. If you take the small example of a procedure to perform the MOD operation, then there are about 4 lines of asm code which do the work and 22 + 4 * (number of local variables/parameters) which fiddle the stack.
It might only be useful for small procedures of assembly, but that is not an insignificant number of instructions if you are calling something a lot of times.
--
I used to be a nihilist but I don't believe in that any more.
(Win98first ed. + all updates, PB3.62, external editor)
I was specifically thinking of the assembler heads when I suggested that (they might prefer to create it their own way, or not at all if not required), so it might be fairly useless for basic programmers. The parameters (which are local variables) could still be accessable from the stack I suppose.Originally posted by El_Choni
Not a bad idea, but, where would locals be then?No stack frame - PureBasic does not do any manipulation of the stack for storing local variables (might be useful for ASM coders?)
The only reason I thought of this was when I was looking at the created assembly. If you take the small example of a procedure to perform the MOD operation, then there are about 4 lines of asm code which do the work and 22 + 4 * (number of local variables/parameters) which fiddle the stack.
It might only be useful for small procedures of assembly, but that is not an insignificant number of instructions if you are calling something a lot of times.
--
I used to be a nihilist but I don't believe in that any more.
(Win98first ed. + all updates, PB3.62, external editor)
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm