Changeset 11b285d in mainline for kernel/generic/src/synch/futex.c


Ignore:
Timestamp:
2018-05-13T15:19:32Z (6 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).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/synch/futex.c

    r13db2044 r11b285d  
    156156void futex_task_init(struct task *task)
    157157{
    158         task->futexes = malloc(sizeof(struct futex_cache), 0);
     158        task->futexes = nfmalloc(sizeof(struct futex_cache));
    159159
    160160        cht_create(&task->futexes->ht, 0, 0, 0, true, &task_futex_ht_ops);
     
    339339static futex_t *get_and_cache_futex(uintptr_t phys_addr, uintptr_t uaddr)
    340340{
    341         futex_t *futex = malloc(sizeof(futex_t), FRAME_ATOMIC);
     341        futex_t *futex = malloc(sizeof(futex_t));
    342342        if (!futex)
    343343                return NULL;
     
    365365         * Cache the link to the futex object for this task.
    366366         */
    367         futex_ptr_t *fut_ptr = malloc(sizeof(futex_ptr_t), FRAME_ATOMIC);
     367        futex_ptr_t *fut_ptr = malloc(sizeof(futex_ptr_t));
    368368        if (!fut_ptr) {
    369369                spinlock_lock(&futex_ht_lock);
Note: See TracChangeset for help on using the changeset viewer.