Changeset 11b285d in mainline for kernel/generic/src/adt


Ignore:
Timestamp:
2018-05-13T15:19:32Z (8 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ad896eb
Parents:
13db2044
git-author:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-05-13 14:59:01)
git-committer:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-05-13 15:19:32)
Message:

Use standard signature for malloc() in kernel.

The remaining instances of blocking allocation are replaced with
a new separate function named nfmalloc (short for non-failing malloc).

Location:
kernel/generic/src/adt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/adt/cht.c

    r13db2044 r11b285d  
    573573        size_t bytes =
    574574            sizeof(cht_buckets_t) + (bucket_cnt - 1) * sizeof(marked_ptr_t);
    575         cht_buckets_t *b = malloc(bytes, can_block ? 0 : FRAME_ATOMIC);
     575        cht_buckets_t *b = can_block ? nfmalloc(bytes) : malloc(bytes);
    576576
    577577        if (!b)
  • kernel/generic/src/adt/hash_table.c

    r13db2044 r11b285d  
    401401        assert(pbuckets && HT_MIN_BUCKETS <= bucket_cnt);
    402402
    403         list_t *buckets = malloc(bucket_cnt * sizeof(list_t), FRAME_ATOMIC);
     403        list_t *buckets = malloc(bucket_cnt * sizeof(list_t));
    404404        if (!buckets)
    405405                return false;
Note: See TracChangeset for help on using the changeset viewer.