Maurice Lombardi wrote:
Adriaan van Os a écrit:
The problem disappears when I change
type PMemList = ^PMemList;
to
type PMemList = ^Pointer;
in the function MemAvail in units/system.pas. I think that explains it. Apparently the stabs symbol generator doesn't like the
type PMemList = ^PMemList
Indeed. What does this mean: a type is a pointer to himself
It's just a place-holder for the MemAvail kludge. (Actually, the allocated memory is usually bigger than the declared size, and it's allocated with GetMem, not New. Usually GetMem is not recommended, but since these functions actually deal with memory size, GetMem seems more appropriate than, say, a schema type.)
In a rather old version of gpc I found
type PMemList = ^TMemList; TMemList = record Next : PMemList end;
Which makes sense for me.
Actually it's hardly different from the original type. Regularly, you can do just the same with both -- build lists (or graphs with at most one child per node) with no additional info.
But this change has survived for many versions.
AFAIR, the current definition didn't work with GPC when the function was originally written, therefore the record. But AFAIK, the current definition is valid Pascal, so I changed it sometime.
Frank