Пример #1
0
void MemoryModuleInit() {
     int i;
     int curpage;
   
     dbprintf('m',"MemoryGetsize() is %d\n",MemoryGetSize());
     dbprintf('m',"MEM_PAGESIZE is %d\n",MEM_PAGESIZE);
     SetPara();
    //All memory is in use
     for (curpage=0;curpage<(MemoryGetSize()/(MEM_PAGESIZE));curpage++) {
//         printf("curpage is %d\n",curpage);
         MemorySetFreemap(curpage,0);
     }
         
     //all the other memory space is unused
     for (curpage = ((lastosaddress+(MEM_PAGESIZE))/(MEM_PAGESIZE));curpage <(MemoryGetSize()/(MEM_PAGESIZE)); curpage++)
      {
 //        printf("curpage is %d\n",curpage);
         MemorySetFreemap (curpage, 1);
      }

    //print for debug 
     for(i=0;i<16;i++){
     dbprintf('m',"freemap is 0x%x\n",freemap[i]);
     }
}
Пример #2
0
int main( int argc, char** argv) {
    printf("start emps.\n");
    RdDat();
    AlcBkt();
    SetPara();

    double timer_sta = get_dtime();

    ClcEMPS();

    double timer_end = get_dtime();
    printf("Total        : %13.6lf sec\n",timer_end -timer_sta);


    free(Acc);
    free(Pos);
    free(Vel);
    free(Prs);
    free(pav);
    free(Typ);
    free(bfst);
    free(blst);
    free(nxt);
    printf("end emps.\n");
    return 0;
}