const lcpp::Type& lcpp::LispFunction_UserDefined::typeInfo() { static auto t = Type::create(Type::Flags::Callable | Type::Flags::Nameable | Type::Flags::UserDefined, EZ_STRINGIZE(LispFunction_UserDefined), "function (userdefined)", MemoryInfo(sizeof(LispFunction_UserDefined), sizeof(LispFunction_UserDefined))); return t; }
const lcpp::Type& lcpp::LispFunction_BuiltIn::typeInfo() { static auto t = Type::create(Type::Flags::Callable | Type::Flags::Nameable, EZ_STRINGIZE(LispFunction_BuiltIn), "function (built-in)", MemoryInfo(sizeof(LispFunction_BuiltIn), sizeof(LispFunction_BuiltIn))); return t; }
const lcpp::Type& lcpp::LispFunction::typeInfo() { static auto t = Type::create(Type::Flags::Abstract | Type::Flags::Callable, EZ_STRINGIZE(LispFunction), "function (base)", MemoryInfo(sizeof(LispFunction), sizeof(LispFunction))); return t; }
const lcpp::Type& lcpp::LispCons::typeInfo() { static auto t = Type::create(Type::Flags::None, EZ_STRINGIZE(LispCons), "cons", MemoryInfo(sizeof(LispCons), EZ_ALIGNMENT_OF(LispCons))); return t; }
void Pedigree::ShowMemoryInfo() { unsigned int bytes = 0; for (int i = 0; i < count; i++) bytes += persons[i]->famid.BufferSize() + persons[i]->pid.BufferSize() + persons[i]->fatid.BufferSize() + persons[i]->motid.BufferSize(); bytes += count * (markerCount * sizeof(Alleles) + traitCount * sizeof(double) + covariateCount * sizeof(double) + affectionCount * sizeof(char) + sizeof(Person)); printf(" %40s %s\n", "Pedigree file ...", (const char *) MemoryInfo(bytes)); }
void DosageCalculator::EstimateMemoryInfo(int Samples, int Genotypes, int Markers) { if (storeDosage == false && storeDistribution == false) return; int bytesPerItem = Samples < (UCHAR_MAX / 2) ? sizeof(unsigned char) : Samples < (USHRT_MAX / 2) ? sizeof(unsigned short) : sizeof(unsigned int); double bytes = bytesPerItem * (double) Genotypes * Markers; if (storeDistribution) bytes *= 2; printf(" %40s %s\n", "Dosage Calculator ...", (const char *) MemoryInfo(bytes)); }
void main() { // char c[]="Hello World"; // Queue* q = InitQueue(); int i=0; // for (i=0;i<5;i++) {QueuePush(q,&(c[i]));} // for (i=0;i<5;i++) printf("%c",*(char*)QueuePop(q)); // for (i=5;i<11;i++) {QueuePush(q,&(c[i]));} // for (i=0;i<5;i++) printf("%c",*(char*)QueuePop(q)); // // printf("%d\n",q->size); // DeleteQueue(q); IMG_Init(0); SDL_Surface* sf = IMG_Load("1.jpg"); IMG_Quit(); SDL_Init(SDL_INIT_EVERYTHING); SDL_Surface* screen = SDL_SetVideoMode( FRAME_WIDTH*2, FRAME_HEIGHT, 24, SDL_SWSURFACE ); SDL_Rect r = {0,0,FRAME_WIDTH,FRAME_HEIGHT}; SDL_Event event; char buf[256]; Pixmap* px = PixmapFromSdlSurface(sf); #if USE_BITFIELD printf("Using bitfield optimization ...\n"); Pixmap* px2 = PixmapThresholding(px,0.2); #else Pixmap* px2 = PixmapThresholdingSimple(px,0.2); SavePixmap(px2,"1.bmp"); #endif Pixmap* dup = PixmapCopy(px2); Timer* timer = TimerStart(); for (i=0;i<1;i++) { #if USE_BITFIELD PixmapErosion(px2,1); #else PixmapErosionSimple(px2,1); #endif } SavePixmap(px2,"2.bmp"); printf("time taken: %fs\n",TimerEnd(timer)); // SDL_BlitSurface(sf,&r,screen,NULL); SDL_Surface* res = SdlSurfaceFromPixmap(dup); SDL_BlitSurface(res,&r,screen,NULL); r.x=FRAME_WIDTH; res = SdlSurfaceFromPixmap(px2); SDL_BlitSurface(res,NULL,screen,&r); SDL_Flip(screen); while (1) { if (SDL_PollEvent(&event)) { if (event.type==SDL_QUIT) break; } } printf("Memory used: %s\n",GetMemoryRepr(buf,MemoryInfo())); DeletePixmap(px); DeletePixmap(px2); // SDL_FreeSurface(res); // SDL_FreeSurface(sf); // SDL_FreeSurface(screen); SDL_Quit(); printf("Memory used: %s\n",GetMemoryRepr(buf,MemoryInfo())); }