struct plugin_api {
struct server_config *config;
struct sched_list_node **sched_list;
-
- void (*malloc)(void *);
+ /* Functions */
+ void *(*malloc)(int *);
};
typedef char mk_plugin_data_t[];
api = mk_mem_malloc_z(sizeof(struct plugin_api));
api->config = config;
api->sched_list = &sched_list;
+ api->malloc = (void *) mk_mem_malloc;
path = mk_mem_malloc_z(1024);
snprintf(path, 1024, "%s/%s", config->serverconf, MK_PLUGIN_LOAD);
void mk_cheetah_print_worker_memory_usage(pid_t pid)
{
int last, init, n, c = 0;
+ int s = 1024;
char *buf;
char *value;
pid_t ppid;
FILE *f;
ppid = getpid();
- buf = malloc(1024);
+ buf = papi->malloc(s);
sprintf(buf, MK_CHEETAH_PROC_TASK, ppid, pid);
f = fopen(buf, "r");
return;
}
- buf = fgets(buf, 1024, f);
+ buf = fgets(buf, s, f);
if(!buf){
printf("Cannot format details\n");
return;