Changeset bcd4dd4 in mainline


Ignore:
Timestamp:
2018-11-13T20:19:10Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b0beb9b1
Parents:
fdc190f
Message:

Use ispwr2 macro

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/mm/malloc.c

    rfdc190f rbcd4dd4  
    3636#include <mem.h>
    3737#include <main/main.h> // malloc_init()
     38#include <macros.h>
    3839
    3940/** Minimum size to be allocated by malloc */
     
    8283}
    8384
    84 static inline bool _is_pow2(size_t x)
    85 {
    86         return (x & (x - 1)) == 0;
    87 }
    88 
    8985static void _check_sizes(size_t *alignment, size_t *size)
    9086{
     
    9793
    9894        /* Alignment must be a power of 2. */
    99         assert(_is_pow2(*alignment));
     95        assert(ispwr2(*alignment));
    10096        assert(*alignment <= PAGE_SIZE);
    10197
Note: See TracChangeset for help on using the changeset viewer.