home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 3
/
AACD03.BIN
/
AACD
/
Programming
/
sofa
/
archive
/
SmallEiffel.lha
/
SmallEiffel
/
lib_show
/
directory
/
example013.c
< prev
next >
Wrap
C/C++ Source or Header
|
1999-06-05
|
8KB
|
396 lines
/*
-- ANSI C code generated by :
-- SmallEiffel The GNU Eiffel Compiler -- Release (- 0.78Beta#1)--
-- Copyright (C), 1994-98 - LORIA - UHP - CRIN - INRIA - FRANCE --
-- Dominique COLNET and Suzanne COLLIN - colnet@loria.fr --
-- http://SmallEiffel.loria.fr/ --
*/
#include "example01.h"
void gc_align_mark714(fsoc*c,gc714*p){
gc714*b=(void*)(&(c->first_object));
if((c->header.state_type==FSO_STORE_CHUNK)&&(((char*)p)>=((char*)store714)))return;
if(((char*)p)>((char*)(b+(c->count_minus_one))))return;
if(((char*)p)<((char*)b))return;
if(((((char*)p)-((char*)b))%sizeof(*p))==0){
if(p->header.flag==FSOH_UNMARKED){
T714*o=(void*)p;
((gc714*)o)->header.flag=FSOH_MARKED;
}
}
}
fsoc H714={{FSOC_SIZE,FSO_STORE_CHUNK,
(void(*)(mch*,void*))gc_align_mark714,
(void(*)(mch*))gc_sweep714},NULL,(((FSOC_SIZE-sizeof(fsoc)+sizeof(double))/sizeof(gc714))-1)};
T714*new714(void){
gc714*n;
if(store_left714>1){
store_left714--;
n=store714++;
}
else if (gc_free714!=NULL){
n=gc_free714;
gc_free714=n->header.next;
}
else if(store_left714==1){
store_left714=0;
store_chunk714->header.state_type=FSO_USED_CHUNK;
n=store714++;
}
else if(fsocfl!=NULL) {
store_chunk714=fsocfl;
fsocfl=fsocfl->next;
*store_chunk714=H714;
store714=(void*)(&(store_chunk714->first_object));
store_left714=H714.count_minus_one;
n=store714++;
}
else if(fsoc_count_ceil>fsoc_count) {
store_chunk714=malloc(FSOC_SIZE);
fsoc_count++;
{mch**p;
if(gcmt_used==gcmt_max){
gcmt_max<<=1;
gcmt=realloc(gcmt,(gcmt_max+1)*sizeof(void*));
}
for(p=gcmt+(gcmt_used++ -1);(p>=gcmt)&&(*p>((mch*)store_chunk714));p--)
*(p+1)=*p;
*(p+1)=(mch*)store_chunk714;
}
*store_chunk714=H714;
store714=(void*)(&(store_chunk714->first_object));
store_left714=H714.count_minus_one;
n=store714++;
}
else{
gc_start();
if(NULL!=gc_free714){
n=gc_free714;
gc_free714=n->header.next;
}
else{
store_chunk714=new_fsoc();
*store_chunk714=H714;
store714=(void*)(&(store_chunk714->first_object));
store_left714=H714.count_minus_one;
n=store714++;
}
}
n->header.flag=FSOH_UNMARKED;
n->object=M714;
return (void*)n;
}
void gc_sweep528(fsoc*c){
gc528*o1,*o2,*flt,flh;
o1=((void*)(&(c->first_object)));
if(c->header.state_type==FSO_STORE_CHUNK){
for(;o1<store528;o1++){
if((o1->header.flag)==FSOH_MARKED){
o1->header.flag=FSOH_UNMARKED;
}
else{
o1->header.next=gc_free528;
gc_free528=o1;
}
}
}
else{
int dead=1;
flh.header.next=NULL;
flt=&flh;
o2=o1+c->count_minus_one;
for(;o1<=o2;o2--){
if((o2->header.flag)==FSOH_MARKED){
o2->header.flag=FSOH_UNMARKED;
dead=0;}
else{
flt->header.next=o2;
flt=o2;
}
}
if (dead){
c->next=fsocfl;
fsocfl=c;
c->header.state_type=FSO_FREE_CHUNK;
}
else if(flh.header.next!=NULL){
flt->header.next=gc_free528;
gc_free528=flh.header.next;
}
}
}
void gc_mark528(T528*o){
se_gc_check_id(o,528);
{((gc528*)o)->header.flag=FSOH_MARKED;
}}
void gc_align_mark528(fsoc*c,gc528*p){
gc528*b=(void*)(&(c->first_object));
if((c->header.state_type==FSO_STORE_CHUNK)&&(((char*)p)>=((char*)store528)))return;
if(((char*)p)>((char*)(b+(c->count_minus_one))))return;
if(((char*)p)<((char*)b))return;
if(((((char*)p)-((char*)b))%sizeof(*p))==0){
if(p->header.flag==FSOH_UNMARKED){
T528*o=(void*)p;
((gc528*)o)->header.flag=FSOH_MARKED;
}
}
}
fsoc H528={{FSOC_SIZE,FSO_STORE_CHUNK,
(void(*)(mch*,void*))gc_align_mark528,
(void(*)(mch*))gc_sweep528},NULL,(((FSOC_SIZE-sizeof(fsoc)+sizeof(double))/sizeof(gc528))-1)};
T528*new528(void){
gc528*n;
if(store_left528>1){
store_left528--;
n=store528++;
}
else if (gc_free528!=NULL){
n=gc_free528;
gc_free528=n->header.next;
}
else if(store_left528==1){
store_left528=0;
store_chunk528->header.state_type=FSO_USED_CHUNK;
n=store528++;
}
else if(fsocfl!=NULL) {
store_chunk528=fsocfl;
fsocfl=fsocfl->next;
*store_chunk528=H528;
store528=(void*)(&(store_chunk528->first_object));
store_left528=H528.count_minus_one;
n=store528++;
}
else if(fsoc_count_ceil>fsoc_count) {
store_chunk528=malloc(FSOC_SIZE);
fsoc_count++;
{mch**p;
if(gcmt_used==gcmt_max){
gcmt_max<<=1;
gcmt=realloc(gcmt,(gcmt_max+1)*sizeof(void*));
}
for(p=gcmt+(gcmt_used++ -1);(p>=gcmt)&&(*p>((mch*)store_chunk528));p--)
*(p+1)=*p;
*(p+1)=(mch*)store_chunk528;
}
*store_chunk528=H528;
store528=(void*)(&(store_chunk528->first_object));
store_left528=H528.count_minus_one;
n=store528++;
}
else{
gc_start();
if(NULL!=gc_free528){
n=gc_free528;
gc_free528=n->header.next;
}
else{
store_chunk528=new_fsoc();
*store_chunk528=H528;
store528=(void*)(&(store_chunk528->first_object));
store_left528=H528.count_minus_one;
n=store528++;
}
}
n->header.flag=FSOH_UNMARKED;
n->object=M528;
return (void*)n;
}
void Xgc_mark878(T0*o){
{int i=o->id;
if (i <= 878) {
gc_mark878((T878*)o);
} else {
gc_mark2074((T2074*)o);
}}}
T6 X98standard_is_equal(se_dump_stack*caller,int l,int c,int f, void *C,T0* a1){
T6 R=0;
se_dump_stack ds=*caller;
{int id=vc(C,l,c,f)->id;
switch(id){
case 7:R=((T6)(r7standard_is_equal(&ds,se_i7(&ds,((T7*)C)),a1)));
break;
case 474:R=((T6)(r474standard_is_equal(&ds,((T474*)C),a1)));
break;
case 528:R=((T6)(r528standard_is_equal(&ds,((T528*)C),a1)));
break;
case 660:R=((T6)(r660standard_is_equal(&ds,((T660*)C),a1)));
break;
case 701:R=((T6)(r701standard_is_equal(&ds,((T701*)C),a1)));
break;
case 714:R=((T6)(r714standard_is_equal(&ds,((T714*)C),a1)));
break;
case 878:R=((T6)(r878standard_is_equal(&ds,((T878*)C),a1)));
break;
case 1405:R=((T6)(r1405standard_is_equal(&ds,((T1405*)C),a1)));
break;
case 1886:R=((T6)(r1886standard_is_equal(&ds,se_i1886(&ds,((T1886*)C)),a1)));
break;
case 2074:R=((T6)(r2074standard_is_equal(&ds,((T2074*)C),a1)));
break;
default: error2(C,l,c,f);
}
}
se_dst=caller;
return R;
}
T6 X98is_equal(se_dump_stack*caller,int l,int c,int f, void *C,T0* a1){
T6 R=0;
se_dump_stack ds=*caller;
{int id=vc(C,l,c,f)->id;
switch(id){
case 7:R=((T6)(r7is_equal(&ds,se_i7(&ds,((T7*)C)),a1)));
break;
case 474:R=((T6)(r474is_equal(&ds,((T474*)C),a1)));
break;
case 528:R=((T6)(r528is_equal(&ds,((T528*)C),a1)));
break;
case 660:R=((T6)(r660is_equal(&ds,((T660*)C),a1)));
break;
case 701:R=((T6)(r701is_equal(&ds,((T701*)C),a1)));
break;
case 714:R=((T6)(r714is_equal(&ds,((T714*)C),a1)));
break;
case 878:R=((T6)(r878is_equal(&ds,((T878*)C),a1)));
break;
case 1405:R=((T6)(r1405is_equal(&ds,((T1405*)C),a1)));
break;
case 1886:R=((T6)(r1886is_equal(&ds,se_i1886(&ds,((T1886*)C)),a1)));
break;
case 2074:R=((T6)(r2074is_equal(&ds,((T2074*)C),a1)));
break;
default: error2(C,l,c,f);
}
}
se_dst=caller;
return R;
}
T6 X878standard_is_equal(se_dump_stack*caller,int l,int c,int f, void *C,T0* a1){
T6 R=0;
se_dump_stack ds=*caller;
{int id=vc(C,l,c,f)->id;
switch(id){
case 878:R=((T6)(r878standard_is_equal(&ds,((T878*)C),a1)));
break;
case 2074:R=((T6)(r2074standard_is_equal(&ds,((T2074*)C),a1)));
break;
default: error2(C,l,c,f);
}
}
se_dst=caller;
return R;
}
T6 X878is_equal(se_dump_stack*caller,int l,int c,int f, void *C,T0* a1){
T6 R=0;
se_dump_stack ds=*caller;
{int id=vc(C,l,c,f)->id;
switch(id){
case 878:R=((T6)(r878is_equal(&ds,((T878*)C),a1)));
break;
case 2074:R=((T6)(r2074is_equal(&ds,((T2074*)C),a1)));
break;
default: error2(C,l,c,f);
}
}
se_dst=caller;
return R;
}
void X878put_string(se_dump_stack*caller,int l,int c,int f, void *C,T0* a1){
se_dump_stack ds=*caller;
{int id=vc(C,l,c,f)->id;
switch(id){
case 878:r878put_string(&ds,((T878*)C),a1);
break;
case 2074:r2074put_string(&ds,((T2074*)C),a1);
break;
default: error2(C,l,c,f);
}
}
se_dst=caller;
}
void X878put_character(se_dump_stack*caller,int l,int c,int f, void *C,T3 a1){
se_dump_stack ds=*caller;
{int id=vc(C,l,c,f)->id;
switch(id){
case 878:r878put_character(&ds,((T878*)C),a1);
break;
case 2074:r2074put_character(&ds,((T2074*)C),a1);
break;
default: error2(C,l,c,f);
}
}
se_dst=caller;
}
void X878put_integer(se_dump_stack*caller,int l,int c,int f, void *C,T2 a1){
se_dump_stack ds=*caller;
{int id=vc(C,l,c,f)->id;
switch(id){
case 878:r878put_integer(&ds,((T878*)C),a1);
break;
case 2074:r2074put_integer(&ds,((T2074*)C),a1);
break;
default: error2(C,l,c,f);
}
}
se_dst=caller;
}