mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 11:09:42 +02:00
* use __stklen
This commit is contained in:
parent
698bdc9926
commit
78ff575ee4
@ -1,34 +1,34 @@
|
||||
{ Old file: tbs0227.pp }
|
||||
{ external var does strange things when declared in localsymtable OK 0.99.11 (PFV) }
|
||||
|
||||
function getheapsize:longint;assembler;
|
||||
function getstacksize:longint;assembler;
|
||||
var
|
||||
heapsize : longint;external name 'HEAPSIZE';
|
||||
stacksize : ptrint;external name '__stklen';
|
||||
// sbrk : longint;external name '___sbrk';
|
||||
asm
|
||||
{$ifdef CPUI386}
|
||||
movl HEAPSIZE,%eax
|
||||
movl stacksize,%eax
|
||||
end ['EAX'];
|
||||
{$endif CPUI386}
|
||||
{$ifdef CPUX86_64}
|
||||
movl HEAPSIZE,%eax
|
||||
movl stacksize,%eax
|
||||
end ['EAX'];
|
||||
{$endif CPUX86_64}
|
||||
{$ifdef CPU68K}
|
||||
move.l HEAPSIZE,d0
|
||||
move.l stacksize,d0
|
||||
end ['D0'];
|
||||
{$endif CPU68K}
|
||||
{$ifdef cpupowerpc}
|
||||
lis r3, heapsize@ha
|
||||
lwz r3, heapsize@l(r3)
|
||||
lis r3, stacksize@ha
|
||||
lwz r3, stacksize@l(r3)
|
||||
end;
|
||||
{$endif cpupowerpc}
|
||||
{$ifdef cpusparc}
|
||||
sethi %hi(heapsize),%i0
|
||||
or %i0,%lo(heapsize),%i0
|
||||
sethi %hi(stacksize),%i0
|
||||
or %i0,%lo(stacksize),%i0
|
||||
end;
|
||||
{$endif cpusparc}
|
||||
begin
|
||||
writeln(getheapsize);
|
||||
writeln(getstacksize);
|
||||
end.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user