Mercurial > hg > CbC > old > device
view test/device.d @ 739:0c7a6ae119ba
i64 continue... compiler compiled.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 08 Nov 2010 22:22:46 +0900 |
parents | d35df41eac69 |
children |
line wrap: on
line source
struct env_segment1 { void *fp; void *sp; } struct cont_segment1 { int value; *return(); } segment1(env_segment1 e, cont_segment1 c) { cont_segment1 c1 = new_continuation(c,e); c.return = segment2; call_segment(e,c1); } call_segment(env_segment1 e, cont_segment1 c) { c.value = 1; c.return(); } segment2(env_segment2 e, cont_segment1 c) { cont_segment1 c1 = old_continuation(e); halt(e,c); } inline type new_continuation(c,e) { e.fp -= sizeof(type); return (type)e.fp; } inline type old_continuation(c,e) { e.fp += sizeof(c); return (type)e.fp; }