ocamllabs/ocaml-ctypes — pull request #168 by yallop (2014-08-01 11:00:41+00:00)
Title: Remove offsets

The internal representation of pointers previously used an `〈address,offset〉` pair. The offset once performed a useful function — it formed the basis for an efficient representation based on word-aligned pointers — but nowadays it's just a source of bugs.

This pull request removes the offset from the pointer representation and from the argument list of various functions. That is, it moves address computations from C into OCaml, and performs them eagerly.

The representation of pointers into the OCaml heap still uses offsets, since those pointers are stored as OCaml references, which don't support arithmetic.

This has been put together quickly, and needs another read through before merge, although it passes the tests.