Changeset 11b285d in mainline for kernel/generic/src/sysinfo/stats.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/sysinfo/stats.c

    r13db2044 r11b285d  
    101101
    102102        /* Assumption: config.cpu_count is constant */
    103         stats_cpu_t *stats_cpus = (stats_cpu_t *) malloc(*size, FRAME_ATOMIC);
     103        stats_cpu_t *stats_cpus = (stats_cpu_t *) malloc(*size);
    104104        if (stats_cpus == NULL) {
    105105                *size = 0;
     
    307307        }
    308308
    309         stats_task_t *stats_tasks = (stats_task_t *) malloc(*size, FRAME_ATOMIC);
     309        stats_task_t *stats_tasks = (stats_task_t *) malloc(*size);
    310310        if (stats_tasks == NULL) {
    311311                /* No free space for allocation */
     
    413413        }
    414414
    415         stats_thread_t *stats_threads = (stats_thread_t *) malloc(*size, FRAME_ATOMIC);
     415        stats_thread_t *stats_threads = (stats_thread_t *) malloc(*size);
    416416        if (stats_threads == NULL) {
    417417                /* No free space for allocation */
     
    479479                /* Allocate stats_task_t structure */
    480480                stats_task_t *stats_task =
    481                     (stats_task_t *) malloc(sizeof(stats_task_t), FRAME_ATOMIC);
     481                    (stats_task_t *) malloc(sizeof(stats_task_t));
    482482                if (stats_task == NULL) {
    483483                        irq_spinlock_unlock(&tasks_lock, true);
     
    550550                /* Allocate stats_thread_t structure */
    551551                stats_thread_t *stats_thread =
    552                     (stats_thread_t *) malloc(sizeof(stats_thread_t), FRAME_ATOMIC);
     552                    (stats_thread_t *) malloc(sizeof(stats_thread_t));
    553553                if (stats_thread == NULL) {
    554554                        irq_spinlock_unlock(&threads_lock, true);
     
    592592
    593593        stats_exc_t *stats_exceptions =
    594             (stats_exc_t *) malloc(*size, FRAME_ATOMIC);
     594            (stats_exc_t *) malloc(*size);
    595595        if (stats_exceptions == NULL) {
    596596                /* No free space for allocation */
     
    670670                /* Allocate stats_exc_t structure */
    671671                stats_exc_t *stats_exception =
    672                     (stats_exc_t *) malloc(sizeof(stats_exc_t), FRAME_ATOMIC);
     672                    (stats_exc_t *) malloc(sizeof(stats_exc_t));
    673673                if (stats_exception == NULL)
    674674                        return ret;
     
    713713
    714714        stats_physmem_t *stats_physmem =
    715             (stats_physmem_t *) malloc(*size, FRAME_ATOMIC);
     715            (stats_physmem_t *) malloc(*size);
    716716        if (stats_physmem == NULL) {
    717717                *size = 0;
     
    743743                return NULL;
    744744
    745         load_t *stats_load = (load_t *) malloc(*size, FRAME_ATOMIC);
     745        load_t *stats_load = (load_t *) malloc(*size);
    746746        if (stats_load == NULL) {
    747747                *size = 0;
Note: See TracChangeset for help on using the changeset viewer.