|
17 | 17 | static inline void increase_allocated_bytes(struct z_heap *h, size_t num_bytes) |
18 | 18 | { |
19 | 19 | h->allocated_bytes += num_bytes; |
20 | | - h->max_allocated_bytes = MAX(h->max_allocated_bytes, h->allocated_bytes); |
| 20 | + h->max_allocated_bytes = max(h->max_allocated_bytes, h->allocated_bytes); |
21 | 21 | } |
22 | 22 | #endif |
23 | 23 |
|
@@ -321,7 +321,7 @@ void *sys_heap_aligned_alloc(struct sys_heap *heap, size_t align, size_t bytes) |
321 | 321 | rew = align & -align; |
322 | 322 | if (align != rew) { |
323 | 323 | align -= rew; |
324 | | - gap = MIN(rew, chunk_header_bytes(h)); |
| 324 | + gap = min(rew, chunk_header_bytes(h)); |
325 | 325 | } else { |
326 | 326 | if (align <= chunk_header_bytes(h)) { |
327 | 327 | return sys_heap_alloc(heap, bytes); |
@@ -482,7 +482,7 @@ void *sys_heap_realloc(struct sys_heap *heap, void *ptr, size_t bytes) |
482 | 482 | if (ptr2 != NULL) { |
483 | 483 | size_t prev_size = sys_heap_usable_size(heap, ptr); |
484 | 484 |
|
485 | | - memcpy(ptr2, ptr, MIN(prev_size, bytes)); |
| 485 | + memcpy(ptr2, ptr, min(prev_size, bytes)); |
486 | 486 | sys_heap_free(heap, ptr); |
487 | 487 | } |
488 | 488 | return ptr2; |
@@ -516,7 +516,7 @@ void *sys_heap_aligned_realloc(struct sys_heap *heap, void *ptr, |
516 | 516 | if (ptr2 != NULL) { |
517 | 517 | size_t prev_size = sys_heap_usable_size(heap, ptr); |
518 | 518 |
|
519 | | - memcpy(ptr2, ptr, MIN(prev_size, bytes)); |
| 519 | + memcpy(ptr2, ptr, min(prev_size, bytes)); |
520 | 520 | sys_heap_free(heap, ptr); |
521 | 521 | } |
522 | 522 | return ptr2; |
|
0 commit comments