Jump to content

ErikI

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by ErikI

  1. Excellent work! The application I originally discovered the bug with works nicely now. Thank you!
  2. Ok, so I wrote a test that creates and deletes pixmaps with very various dimensions. I also added breakpoints at gfxAlloc to keep track of where the memory is allocated. gfxInit(); GDisplay *pixmapDynamic; pixel_t *surfaceDynamic; pixmapDynamic = gdispPixmapCreate(100, 100); gdispPixmapDelete(pixmapDynamic); pixmapDynamic = gdispPixmapCreate(72, 63); gdispPixmapDelete(pixmapDynamic); pixmapDynamic = gdispPixmapCreate(22, 58); gdispPixmapDelete(pixmapDynamic); pixmapDynamic = gdispPixmapCreate(44, 87); gdispPixmapDelete(pixmapDynamic); pixmapDynamic = gdispPixmapCreate(50, 50); gdispPixmapDelete(pixmapDynamic); pixmapDynamic = gdispPixmapCreate(50, 50); gdispPixmapDelete(pixmapDynamic); pixmapDynamic = gdispPixmapCreate(100, 100); gdispPixmapDelete(pixmapDynamic); pixmapDynamic = gdispPixmapCreate(34, 50); gdispPixmapDelete(pixmapDynamic); pixmapDynamic = gdispPixmapCreate(1, 5); gdispPixmapDelete(pixmapDynamic); pixmapDynamic = gdispPixmapCreate(3, 10); gdispPixmapDelete(pixmapDynamic); pixmapDynamic = gdispPixmapCreate(25, 50); gdispPixmapDelete(pixmapDynamic); pixmapDynamic = gdispPixmapCreate(25, 50); gdispPixmapDelete(pixmapDynamic); pixmapDynamic = gdispPixmapCreate(25, 50); gdispPixmapDelete(pixmapDynamic); while (1) ; The allocations seem very weird to me (specially the 53K allocation, largest pixmap is 40K)... See the image included. It also seems that this issue is very dependent to heap size, the current test was ran with: #define GFX_OS_HEAP_SIZE 60000
  3. 1. Yes, I am using fixed size heap. 2. Ok, how to fix this?
  4. Hello I was implementing pixmaps and found a peculiar problem. Long story short: pixmapDynamic = gdispPixmapCreate(width, height); gdispPixmapDelete(pixmapDynamic); Running this code exhausts the heap eventually (memory leak). First run allocates N bytes at "heap+X", second run allocates M bytes at "heap+X+N-Z" and Z much smaller than N. I also ran the gdispPixmapCreate over and over again without running gdispPixmapDelete and logged the allocation addresses. Than compared the allocation addresses while running Create+Delete, the difference was 92 bytes, so it seems that with the Delete frees only 92 bytes (so, Z=92) and rest of the allocated space remains "occupied". I also calculated how much space the pixmap should allocate for the pixel buffer and how much overhead there is per pixmap, and it seems to be 100 bytes. I'm running STM32F4+RAW32
×
×
  • Create New...