Suppose I have a record type called
TSomeRec = record
... and a procedure that takes a const
procedure SomeProc(const someRec: TSomeRec);
SomeProc is called, will the const
someRec argument be passed on the stack as a value or as a reference?
The reason I ask is that in the code I am working on, the record type in question contains a massive static array and so is huge. (No, I cannot change that.) I am nervous about putting such a large record on the stack, and I thought that
const might help. I have had problems with this code with overflowing the stack, and when that happens, I just get mysterious access violations rather than any sort of stack overflow error.