Commit 2ecee6eb authored by Matthias Braun's avatar Matthias Braun
Browse files

remove ir_get_heap_used_bytes() API

The API is not really used, has nothing to do with compilers and uses
glibc/linux/windows specific extensions.
parent 473aaab7
......@@ -38,12 +38,6 @@ FIRM_API int ir_timer_enter_high_priority(void);
*/
FIRM_API int ir_timer_leave_high_priority(void);
/**
* Returns the amount of bytes allocated on the heap.
* @return The number of bytes allocated on the heap.
*/
FIRM_API size_t ir_get_heap_used_bytes(void);
/**
* Create a new timer
* @return The timer.
......
......@@ -271,41 +271,6 @@ int ir_timer_leave_high_priority(void)
#endif
#ifdef __linux__
#include <malloc.h>
size_t ir_get_heap_used_bytes(void)
{
struct mallinfo mi = mallinfo();
return mi.uordblks;
}
#elif defined(_WIN32) /* __linux__ */
#include <malloc.h>
size_t ir_get_heap_used_bytes(void)
{
_HEAPINFO hinfo;
int heapstatus;
size_t res = 0;
hinfo._pentry = NULL;
while ((heapstatus = _heapwalk(&hinfo)) == _HEAPOK)
res += hinfo._useflag == _USEDENTRY ? hinfo._size : 0;
return res;
}
#else
size_t ir_get_heap_used_bytes(void)
{
fprintf(stderr, "function not implemented\n");
return 0;
}
#endif
/* reset a timer */
void ir_timer_reset(ir_timer_t *timer)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment