#include #include #include int max(const int x, const int y) { return (xy?y:x); } int sgn(const int x) { if (x>0) return 1; else if (x<0) return -1; else return 0; } int abs(const int x) { if (x>0) return x; else return -x; } static int ram_used=0; void* mallocProf(int const size) { void* p=malloc(size); if (p) { ll_sendp(LEVEL_INFO, "\n[std] malloc %d OK", size); ram_used++; ll_sendp(LEVEL_INFO, "\n[std] number of zones %d", ram_used); } else ll_sendp(LEVEL_CRITICAL, "\n[std] malloc %d FAILED", size); return p; } void freeProf(void * p) { free(p); ll_sendp(LEVEL_INFO, "\n[std] free called"); ram_used--; ll_sendp(LEVEL_INFO, "\n[std] number of zones %d", ram_used); }