Cluster_vcons& clu(Cluster_vcons::allocate()); vcons& babe(clu.objs[0]);     vcons& vc(babe); vc.sayhello();     vcons& ev(babe); try { fork_and_exception(ev); } catch (vcons*) { printf("exiting... (%d)\n", getpid()); _exit(0); }
int main(void){    // STL allocators experiment    //    vector<int, alloc<int> > v(3);    map<int, int, less<int>, alloc<int> > m;    m.insert(make_pair(1, 42));    cons* c(alloc<cons>().allocate(1));    c->first = c;    c->second = 0;    rooty = c;    collect(true);    // Clusters experiment    //    Cluster_vcons& clu(Cluster_vcons::allocate());    vcons& babe(clu.objs[0]);        // forked exceptions experiment    //    vcons& ev(clu.objs[0]);    try    {        fork_and_exception(ev);    }    catch (vcons*)    {        printf("exiting... (%d)\n", getpid());        _exit(0);    }    // vcons experiment    //    vcons& vc(babe);    vc.sayhello();    // get the world set up    //    int hdl(shm_open("/blubber",                     O_RDWR | O_CREAT,                     S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP));    if (hdl == -1)        perror("shm_open");    int tr(ftruncate(hdl, world::size()));    if (tr == -1)        perror("ftruncate");    world* w(new(hdl) world);    void* area(w);        unsigned long* p((unsigned long*)area);    *p = 0xbeeffece;    w->protectPageRW(0);        struct sigaction act, oact;    memset(&act, 0, sizeof act);    sigemptyset(&act.sa_mask);    act.sa_flags = SA_SIGINFO;    #   ifdef __APPLE__    act.sa_sigaction = yummy;    if (sigaction(SIGBUS, &act, &oact))#   else    act.sa_sigaction = wummy;    if (sigaction(SIGSEGV, &act, &oact))#   endif        perror("sigaction");        {        for (int i(0); i < 100; i += 4)        {            char* p((char*)area + i);            printf("i: %d, o: %p, m: %p\n", i, p, world::Cluster<4, 3>::Raw2Meta(p));            *p = 0;            printf("*p = %x\n", *(unsigned long*)p);        }                for (int i(10000); i < 10100; i += 4)        {            char* p((char*)area + i);            printf("i: %d, o: %p, m: %p\n", i, p, world::Cluster<4, 3>::Raw2Meta(p));            *p = 0;        }                sleep(3);        int um(munmap(area, world::size()));        if (um == -1)            perror("munmap");    }        int ul(shm_unlink("/blubber"));    if (ul == -1)        perror("shm_unlink");    }