Changeset 5e3e42c7 in mainline


Ignore:
Timestamp:
2020-06-16T10:52:38Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
94f3747
Parents:
3e640e5
git-author:
Jiri Svoboda <jiri@…> (2020-06-15 17:31:57)
git-committer:
Jiri Svoboda <jiri@…> (2020-06-16 10:52:38)
Message:

IPC GC server needs to destroy area it shared in

Location:
uspace/lib/ipcgfx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ipcgfx/private/server.h

    r3e640e5 r5e3e42c7  
    4343#include <gfx/context.h>
    4444#include <gfx/coord.h>
     45#include <stdbool.h>
    4546
    4647/** Server-side of IPC GC connection.
     
    6566        /** Bitmap ID */
    6667        sysarg_t bmp_id;
     68        /** @c true if we allocated the pixels */
     69        bool myalloc;
     70        /** Pixels of the bitmap */
     71        void *pixels;
    6772} ipc_gc_srv_bitmap_t;
    6873
  • uspace/lib/ipcgfx/src/server.c

    r3e640e5 r5e3e42c7  
    164164            (unsigned) srvbmp->bmp_id);
    165165
     166        /* We created the memory area by sharing it in */
     167        srvbmp->myalloc = true;
     168        srvbmp->pixels = pixels;
     169
    166170        async_answer_1(icall, EOK, srvbmp->bmp_id);
    167171}
     
    246250        srvbmp->bmp = bitmap;
    247251        srvbmp->bmp_id = srvgc->next_bmp_id++;
     252
     253        /* Area allocated by backing GC, we just shared it out */
     254        srvbmp->myalloc = false;
     255        srvbmp->pixels = alloc.pixels; // Not really needed
     256
    248257        printf("gc_bitmap_create_doutput_srv: storing bmp_id=%u\n",
    249258            (unsigned) srvbmp->bmp_id);
     
    271280                return;
    272281        }
     282
     283        if (bitmap->myalloc)
     284                as_area_destroy(bitmap->pixels);
    273285
    274286        list_remove(&bitmap->lbitmaps);
Note: See TracChangeset for help on using the changeset viewer.