Changeset 7473807 in mainline for kernel/genarch/src


Ignore:
Timestamp:
2018-05-11T20:22:42Z (7 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d2c5159
Parents:
ae89656
Message:

Use atomic malloc allocations

We can safely use atomic allocations in places that use the non-failing
version of malloc(), but test the return value anyway. And also in some
places that can afford to return failure but did not because of comfort.

Location:
kernel/genarch/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/drivers/ega/ega.c

    rae89656 r7473807  
    609609        }
    610610
    611         instance->backbuf = (uint8_t *) malloc(EGA_VRAM_SIZE, 0);
     611        instance->backbuf = (uint8_t *) malloc(EGA_VRAM_SIZE, FRAME_ATOMIC);
    612612        if (!instance->backbuf) {
    613613                LOG("Unable to allocate backbuffer.");
  • kernel/genarch/src/fb/fb.c

    rae89656 r7473807  
    618618        }
    619619
    620         instance->backbuf = (uint16_t *) malloc(bbsize, 0);
     620        instance->backbuf = (uint16_t *) malloc(bbsize, FRAME_ATOMIC);
    621621        if (!instance->backbuf) {
    622622                LOG("Unable to allocate backbuffer.");
     
    626626        }
    627627
    628         instance->glyphs = (uint8_t *) malloc(glyphsize, 0);
     628        instance->glyphs = (uint8_t *) malloc(glyphsize, FRAME_ATOMIC);
    629629        if (!instance->glyphs) {
    630630                LOG("Unable to allocate glyphs.");
     
    635635        }
    636636
    637         instance->bgscan = malloc(instance->bgscanbytes, 0);
     637        instance->bgscan = malloc(instance->bgscanbytes, FRAME_ATOMIC);
    638638        if (!instance->bgscan) {
    639639                LOG("Unable to allocate background pixel.");
Note: See TracChangeset for help on using the changeset viewer.