Sys: Use constant for some runtime limitations. After bootstrap
From: Hugo Heuzard <hugo.heuzard@gmail.com> git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15590 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
82df1b9fb9
commit
8b59f8faef
|
@ -99,6 +99,9 @@ val word_size : int
|
||||||
(** Size of one word on the machine currently executing the OCaml
|
(** Size of one word on the machine currently executing the OCaml
|
||||||
program, in bits: 32 or 64. *)
|
program, in bits: 32 or 64. *)
|
||||||
|
|
||||||
|
val int_size : int
|
||||||
|
(** Size of one int, in bits: 31 or 63. *)
|
||||||
|
|
||||||
val big_endian : bool
|
val big_endian : bool
|
||||||
(** Whether the machine currently executing the Caml program is big-endian.
|
(** Whether the machine currently executing the Caml program is big-endian.
|
||||||
@since 4.00.0 *)
|
@since 4.00.0 *)
|
||||||
|
|
|
@ -21,6 +21,8 @@ external get_config: unit -> string * int * bool = "caml_sys_get_config"
|
||||||
external get_argv: unit -> string * string array = "caml_sys_get_argv"
|
external get_argv: unit -> string * string array = "caml_sys_get_argv"
|
||||||
external big_endian : unit -> bool = "%big_endian"
|
external big_endian : unit -> bool = "%big_endian"
|
||||||
external word_size : unit -> int = "%word_size"
|
external word_size : unit -> int = "%word_size"
|
||||||
|
external int_size : unit -> int = "%int_size"
|
||||||
|
external max_wosize : unit -> int = "%max_wosize"
|
||||||
external unix : unit -> bool = "%ostype_unix"
|
external unix : unit -> bool = "%ostype_unix"
|
||||||
external win32 : unit -> bool = "%ostype_win32"
|
external win32 : unit -> bool = "%ostype_win32"
|
||||||
external cygwin : unit -> bool = "%ostype_cygwin"
|
external cygwin : unit -> bool = "%ostype_cygwin"
|
||||||
|
@ -29,10 +31,11 @@ let (executable_name, argv) = get_argv()
|
||||||
let (os_type, _, _) = get_config()
|
let (os_type, _, _) = get_config()
|
||||||
let big_endian = big_endian ()
|
let big_endian = big_endian ()
|
||||||
let word_size = word_size ()
|
let word_size = word_size ()
|
||||||
|
let int_size = int_size ()
|
||||||
let unix = unix ()
|
let unix = unix ()
|
||||||
let win32 = win32 ()
|
let win32 = win32 ()
|
||||||
let cygwin = cygwin ()
|
let cygwin = cygwin ()
|
||||||
let max_array_length = (1 lsl (word_size - 10)) - 1;;
|
let max_array_length = max_wosize ()
|
||||||
let max_string_length = word_size / 8 * max_array_length - 1;;
|
let max_string_length = word_size / 8 * max_array_length - 1;;
|
||||||
|
|
||||||
external file_exists: string -> bool = "caml_sys_file_exists"
|
external file_exists: string -> bool = "caml_sys_file_exists"
|
||||||
|
|
Loading…
Reference in New Issue