home *** CD-ROM | disk | FTP | other *** search
- #include "DeskLib:WimpSWIs.h"
-
- #include "Shell.Extra.h"
- #include "Shell.TextRect.h"
-
- #include "RemoveBloc.h"
- #include "Update.h"
-
-
-
-
- void RemoveBlock( app_block *app, int pos)
- {
- int i, j, size=0;
- BOOL found = FALSE;
-
- for ( i=0; i<app->num_blocks; i++) {
- if ( app->blocks[i].pos == pos) {
- size = app->blocks[i].size;
- app->stats.total -= app->blocks[i].size;
- for ( j=i+1; j<app->num_blocks; j++) {
- app->blocks[ j-1] = app->blocks[ j];
- }
- app->num_blocks--;
- found = TRUE;
- break;
- }
- }
-
- if ( !found) {
- Shell_TextRectPrintf( app->textrect,
- "Attempt to free non-existent block at location %x\n",
- pos
- );
- }
-
- /*else Shell_ForceRectUpdateSlow( app->heaprect);*/
- ForceRegionUpdate( app, pos, size);
-
- /* Should only update the new bit of the heap... */
- /*
- {
- wimp_rect rect;
- rect.min.x = app->heapdisplay->rect.min.x;
- rect.max.x = app->heapdisplay->rect.max.x;
- rect.min.y = app->heapdisplay->rect.min.y + pos/app->words_per_os;
- rect.max.y = app->heapdisplay->rect.min.y + (pos+size)/app->words_per_os;
- }
- */
-
- }
-