raw
zfp_genesis             1 ------------------------------------------------------------------------------
zfp_genesis 2 ------------------------------------------------------------------------------
zfp_genesis 3 -- You do not have, nor can you ever acquire the right to use, copy or --
zfp_genesis 4 -- distribute this software ; Should you use this software for any purpose, --
zfp_genesis 5 -- or copy and distribute it to anyone or in any manner, you are breaking --
zfp_genesis 6 -- the laws of whatever soi-disant jurisdiction, and you promise to --
zfp_genesis 7 -- continue doing so for the indefinite future. In any case, please --
zfp_genesis 8 -- always : read and understand any software ; verify any PGP signatures --
zfp_genesis 9 -- that you use - for any purpose. --
zfp_genesis 10 -- --
zfp_genesis 11 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
zfp_genesis 12 ------------------------------------------------------------------------------
zfp_genesis 13 ------------------------------------------------------------------------------
zfp_genesis 14
zfp_genesis 15 -- This is the default (used on all native platforms) version of this package
zfp_genesis 16
zfp_genesis 17 pragma Compiler_Unit_Warning;
zfp_genesis 18
zfp_genesis 19 package body System.Parameters is
zfp_genesis 20
zfp_genesis 21 -------------------------
zfp_genesis 22 -- Adjust_Storage_Size --
zfp_genesis 23 -------------------------
zfp_genesis 24
zfp_genesis 25 function Adjust_Storage_Size (Size : Size_Type) return Size_Type is
zfp_genesis 26 begin
zfp_genesis 27 if Size = Unspecified_Size then
zfp_genesis 28 return Default_Stack_Size;
zfp_genesis 29 elsif Size < Minimum_Stack_Size then
zfp_genesis 30 return Minimum_Stack_Size;
zfp_genesis 31 else
zfp_genesis 32 return Size;
zfp_genesis 33 end if;
zfp_genesis 34 end Adjust_Storage_Size;
zfp_genesis 35
zfp_genesis 36 ------------------------
zfp_genesis 37 -- Default_Stack_Size --
zfp_genesis 38 ------------------------
zfp_genesis 39
zfp_genesis 40 function Default_Stack_Size return Size_Type is
zfp_genesis 41 Default_Stack_Size : Integer;
zfp_genesis 42 pragma Import (C, Default_Stack_Size, "__gl_default_stack_size");
zfp_genesis 43 begin
zfp_genesis 44 if Default_Stack_Size = -1 then
zfp_genesis 45 return 2 * 1024 * 1024;
zfp_genesis 46 else
zfp_genesis 47 return Size_Type (Default_Stack_Size);
zfp_genesis 48 end if;
zfp_genesis 49 end Default_Stack_Size;
zfp_genesis 50
zfp_genesis 51 ------------------------
zfp_genesis 52 -- Minimum_Stack_Size --
zfp_genesis 53 ------------------------
zfp_genesis 54
zfp_genesis 55 function Minimum_Stack_Size return Size_Type is
zfp_genesis 56 begin
zfp_genesis 57 -- 12K is required for stack-checking to work reliably on most platforms
zfp_genesis 58 -- when using the GCC scheme to propagate an exception in the ZCX case.
zfp_genesis 59 -- 16K is the value of PTHREAD_STACK_MIN under Linux, so is a reasonable
zfp_genesis 60 -- default.
zfp_genesis 61
zfp_genesis 62 return 16 * 1024;
zfp_genesis 63 end Minimum_Stack_Size;
zfp_genesis 64
zfp_genesis 65 end System.Parameters;