| 1865 | } |
| 1866 | |
| 1867 | static void malloc_rotate_right(struct malloc_pool_s *pool, uint32_t n) |
| 1868 | { |
| 1869 | uint32_t tmp = MA_LEFT(pool, n); |
| 1870 | if ((MA_LEFT(pool, n) = MA_RIGHT(pool, tmp)) != MA_NIL) |
| 1871 | MA_PARENT(pool, MA_RIGHT(pool, tmp)) = n; |
| 1872 | malloc_fix_invariant(pool, n); |
| 1873 | if ((MA_PARENT(pool, tmp) = MA_PARENT(pool, n)) != MA_NIL) |
| 1874 | { |
| 1875 | if (n == MA_LEFT(pool, MA_PARENT(pool, n))) |
| 1876 | MA_LEFT(pool, MA_PARENT(pool, n)) = tmp; |
| 1877 | else |
| 1878 | MA_RIGHT(pool, MA_PARENT(pool, n)) = tmp; |
| 1879 | } else |
| 1880 | pool->root = tmp; |
| 1881 | MA_RIGHT(pool, tmp) = n; |
| 1882 | MA_PARENT(pool, n) = tmp; |
| 1883 | malloc_fix_invariant(pool, tmp); |
| 1884 | if (MA_PARENT(pool, tmp) != MA_NIL) |
| 1885 | malloc_fix_invariant(pool, MA_PARENT(pool, tmp)); |
| 1886 | } |
| 1887 | |
| 1888 | static void malloc_rebalance_insert(struct malloc_pool_s *pool, uint32_t n) |
| 1889 | { |
no test coverage detected