------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- You do not have, nor can you ever acquire the right to use, copy or -- -- distribute this software ; Should you use this software for any purpose, -- -- or copy and distribute it to anyone or in any manner, you are breaking -- -- the laws of whatever soi-disant jurisdiction, and you promise to -- -- continue doing so for the indefinite future. In any case, please -- -- always : read and understand any software ; verify any PGP signatures -- -- that you use - for any purpose. -- -- -- -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . -- ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- This is the default (used on all native platforms) version of this package pragma Compiler_Unit_Warning; package body System.Parameters is ------------------------- -- Adjust_Storage_Size -- ------------------------- function Adjust_Storage_Size (Size : Size_Type) return Size_Type is begin if Size = Unspecified_Size then return Default_Stack_Size; elsif Size < Minimum_Stack_Size then return Minimum_Stack_Size; else return Size; end if; end Adjust_Storage_Size; ------------------------ -- Default_Stack_Size -- ------------------------ function Default_Stack_Size return Size_Type is Default_Stack_Size : Integer; pragma Import (C, Default_Stack_Size, "__gl_default_stack_size"); begin if Default_Stack_Size = -1 then return 2 * 1024 * 1024; else return Size_Type (Default_Stack_Size); end if; end Default_Stack_Size; ------------------------ -- Minimum_Stack_Size -- ------------------------ function Minimum_Stack_Size return Size_Type is begin -- 12K is required for stack-checking to work reliably on most platforms -- when using the GCC scheme to propagate an exception in the ZCX case. -- 16K is the value of PTHREAD_STACK_MIN under Linux, so is a reasonable -- default. return 16 * 1024; end Minimum_Stack_Size; end System.Parameters;