Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] bigarrays and toplevel on Win32?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Dan Grossman <danieljg@c...>
Subject: Re: [Caml-list] bigarrays and toplevel on Win32?

John Prevost wrote:
> >>>>> "xl" == Xavier Leroy <> writes:
>     xl> The party line on unsafe array accesses is unclear: on the one
>     xl> hand, we do not want to encourage their use, as it can break
>     xl> type safety and dramatically reduce the safety of the
>     xl> programs; on the other hand, they are handy when benchmarking
>     xl> against C or Fortran :-)
> Think of it less as an "unsafe array access" and more of "license to
> turn a given set of exceptions into core dumps in exchange for
> efficiency."  ;)
> John.

No.  If I could be guaranteed a core dump on my first out-of-bounds access,
I would be fine with this.  It's why my C code sometimes doesn't check for
null before dereferencing a pointer.  But with arrays, you can silently
corrupt arbitrary memory.  Maybe your program crashes later.  Maybe it ends
up deleting all your files.  Maybe it never tells you that it computed the
wrong answer.

What I would be okay with was doing the bounds-check and exiting (or core
dumping if you prefer) on out-of-bounds.  This still gives an optimizer some
leeway because array-intensive code will have fewer exception-causing


| Dan Grossman H:607 256 0724 |
| 5157 Upson Hall          O:607 255 9834 |
To unsubscribe, mail  Archives: