1
0

memShow.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #include <memLib.h>
  2. #include "private.h"
  3. /*-------------------------------------------------------- */
  4. STATUS
  5. memPartInfoGet(PART_ID partId,
  6. MEM_PART_STATS *ppartStats)
  7. {
  8. partition_t *this = (partition_t*)partId;
  9. lub_heap_stats_t stats;
  10. semTake(&this->sem,WAIT_FOREVER);
  11. lub_heap__get_stats(this->heap,&stats);
  12. ppartStats->maxBlockSizeFree = lub_heap__get_max_free(this->heap);
  13. semGive(&this->sem);
  14. /* now fill out the statistics */
  15. ppartStats->numBytesFree = stats.free_bytes;
  16. ppartStats->numBlocksFree = stats.free_blocks;
  17. ppartStats->numBytesAlloc = stats.alloc_bytes;
  18. ppartStats->numBlocksAlloc = stats.alloc_blocks;
  19. return OK;
  20. }
  21. /*-------------------------------------------------------- */
  22. STATUS
  23. memPartShow(PART_ID partId,
  24. int type)
  25. {
  26. partition_t *this = (partition_t*)partId;
  27. semTake(&this->sem,WAIT_FOREVER);
  28. lub_heap_show(this->heap,type);
  29. semGive(&this->sem);
  30. return OK;
  31. }
  32. /*-------------------------------------------------------- */
  33. void
  34. memShow(int type)
  35. {
  36. memPartShow(memSysPartId,type);
  37. }
  38. /*-------------------------------------------------------- */
  39. void
  40. memShowInit (void)
  41. {
  42. }
  43. /*--------------------------------------------------------- */