URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 304 |
Rev 384 |
with System, System.Storage_Elements;
|
with System, System.Storage_Elements;
|
use System.Storage_Elements;
|
use System.Storage_Elements;
|
|
|
package body Allocator_Maxalign2 is
|
package body Allocator_Maxalign2 is
|
|
|
Max_Align : constant Storage_Offset := Standard'Maximum_Alignment;
|
Max_Align : constant Storage_Offset := Standard'Maximum_Alignment;
|
|
|
procedure Validate is
|
procedure Validate is
|
use type System.Address;
|
use type System.Address;
|
begin
|
begin
|
if Addr mod Max_Align /= 0 then
|
if Addr mod Max_Align /= 0 then
|
raise Program_Error;
|
raise Program_Error;
|
end if;
|
end if;
|
end;
|
end;
|
|
|
procedure Check is
|
procedure Check is
|
I : Integer;
|
I : Integer;
|
B : Block;
|
B : Block;
|
type Block_Access is access all Block;
|
type Block_Access is access all Block;
|
A : Block_Access;
|
A : Block_Access;
|
begin
|
begin
|
Addr := I'Address;
|
Addr := I'Address;
|
Addr := B'Address;
|
Addr := B'Address;
|
Validate;
|
Validate;
|
for I in 1 .. 50 loop
|
for I in 1 .. 50 loop
|
A := new Block;
|
A := new Block;
|
Addr := A.all'Address;
|
Addr := A.all'Address;
|
Validate;
|
Validate;
|
end loop;
|
end loop;
|
|
|
end;
|
end;
|
|
|
end;
|
end;
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.