/* * ep - extended pipelining * * m_memory.c - ncurses memory menu item * ____________________________________________________________ * * Developed by Ondrej Jombik * and Lubomir Host * Copyright (c) 2000-2003 Platon SDG, http://platon.sk/ * All rights reserved. * * See README file for more information about this software. * See COPYING file for license information. * * Download the latest version from * http://platon.sk/projects/ep/ */ /* $Platon: ep/src/m_memory.c,v 1.13 2003/05/03 09:58:19 nepto Exp $ */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #ifdef HAVE_MALLOC_H # include #endif #ifdef STDC_HEADERS # include #endif #if HAVE_MENU # include #include #include "message.h" #include "proctable.h" int menu_memory_info(p_ptbl, y, x) PROCTABLE *p_ptbl; int y; int x; { int c, j, k; struct mallinfo i; chtype hbox = '-', vbox = '|'; int xsize = 32; int ysize = 12; WINDOW *win ; char *str= (char *)malloc(1000*sizeof(char)); win = newwin(ysize, xsize, y, x); if ( win == NULL ) { msg_error_print("NULL pointer to WINDOW\n"); return 0; } wstandout(win); wrefresh(win); i=mallinfo(); sprintf(str, " Total arena space %8.1d \n" " Ordinary blocks %8.1d \n" // " Small blocks %8.1d \n" " Holding blocks %8.1d \n" " Space in headers %8.1d \n" // " Small block use %8.1d \n" // " Small blocks free %8.1d \n" " Ordinary block use %8.1d \n" " Ordinary block free %8.1d \n" " Keep cost %8.1d ", i.arena, i.ordblks, //i.smblks, i.hblks, i.hblkhd, //i.usmblks, /* i.fsmblks, */i.uordblks, i.fordblks, i.keepcost); mvwaddstr(win, 1, 0, str); for (k=0; k<3; k++) for (j=0; j