effect of free()
Chris Torek
chris at mimsy.UUCP
Sun Sep 10 01:09:39 AEST 1989
In article <2065 at munnari.oz.au> ok at cs.mu.oz.au (Richard O'Keefe) writes:
>Can a capability-based machine support a C implementation at all?
>Might that provide an example where a pointer can't be accessed as data
>(thus making pointer-comparison-via-trapping-methods obligatory)?
>What would that do to pointer subtraction, pointers in unions, and so on?
Some Lisp machines implement pointers as <array, size, index> triples.
The code for `*p = 3', on such a machine, is (in pseudo-assembly)
load reg1,p+8 | get index
load reg2,p+4 | get size
compare reg1,reg2
jltu ok | if (unsigned)index < size, is OK
load reg1,<"invalid pointer reference">
jump runtime_error_abort
ok: load reg2,p+0 | get array
store #3,reg2[reg1] | array[index] = 3
--
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain: chris at mimsy.umd.edu Path: uunet!mimsy!chris
More information about the Comp.lang.c
mailing list