Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/src/ml-nlffi-lib/internals/c-debug.sml
ViewVC logotype

View of /sml/trunk/src/ml-nlffi-lib/internals/c-debug.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1098 - (download) (annotate)
Wed Feb 27 17:29:47 2002 UTC (18 years, 7 months ago) by blume
File size: 732 byte(s)
made types in C and C_Debug coincide; simplifications
(*
 * Encoding C's type system in SML.  This module provides the "public"
 * view of the implementation.
 *
 * DEBUG VERSION with CHECKED POINTER DEREFERENCING.
 * 
 *   (C) 2002, Lucent Technologies, Bell Laboratories
 *
 * author: Matthias Blume (blume@research.bell-labs.com)
 *)
structure C_Debug : C_DEBUG = struct
    (* first of all, we look mostly like structure C... *)
    open C

    (* ... but then, we also check for NULL pointers... *)
    exception NullPointer

    (* ... which means that we have to re-implement some things: *)
    structure Ptr = struct
        open Ptr
	val |*! = fn p => if isNull' p then raise NullPointer else |*! p
	val |*| = fn p => if isNull p then raise NullPointer else |*| p
    end
end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0