Changeset ffccdff0 in mainline for uspace/lib/c/generic
- Timestamp:
- 2020-06-15T13:29:29Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4f663f3e
- Parents:
- 128359eb
- Location:
- uspace/lib/c/generic
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/malloc.c
r128359eb rffccdff0 35 35 36 36 #include <malloc.h> 37 #include <stdalign.h> 37 38 #include <stdbool.h> 38 39 #include <stddef.h> … … 198 199 199 200 #define malloc_assert(expr) safe_assert(expr) 201 202 /* 203 * Make sure the base alignment is sufficient. 204 */ 205 static_assert(BASE_ALIGN >= alignof(heap_area_t), ""); 206 static_assert(BASE_ALIGN >= alignof(heap_block_head_t), ""); 207 static_assert(BASE_ALIGN >= alignof(heap_block_foot_t), ""); 208 static_assert(BASE_ALIGN >= alignof(max_align_t), ""); 200 209 201 210 /** Serializes access to the heap from multiple threads. */ -
uspace/lib/c/generic/rtld/module.c
r128359eb rffccdff0 40 40 #include <errno.h> 41 41 #include <loader/pcb.h> 42 #include <stdalign.h> 42 43 #include <stdio.h> 43 44 #include <stdlib.h> … … 353 354 #ifdef CONFIG_TLS_VARIANT_1 354 355 rtld->tls_size = sizeof(tcb_t); 355 rtld->tls_align = _Alignof(tcb_t);356 rtld->tls_align = alignof(tcb_t); 356 357 357 358 list_foreach(rtld->modules, modules_link, module_t, m) { … … 366 367 #else 367 368 rtld->tls_size = 0; 368 rtld->tls_align = _Alignof(tcb_t);369 rtld->tls_align = alignof(tcb_t); 369 370 370 371 list_foreach(rtld->modules, modules_link, module_t, m) { -
uspace/lib/c/generic/thread/tls.c
r128359eb rffccdff0 37 37 38 38 #include <assert.h> 39 #include <stdalign.h> 39 40 #include <stddef.h> 40 41 #include <align.h> … … 69 70 #else 70 71 size_t tls_size = tls ? tls->p_memsz : 0; 71 return -ALIGN_UP((ptrdiff_t) tls_size, max(tls_align, _Alignof(tcb_t)));72 return -ALIGN_UP((ptrdiff_t) tls_size, max(tls_align, alignof(tcb_t))); 72 73 #endif 73 74 } … … 104 105 #else 105 106 size_t alloc_size = 106 ALIGN_UP(tls_size, max(tls_align, _Alignof(tcb_t))) + sizeof(tcb_t);107 #endif 108 109 void *area = alloc(max(tls_align, _Alignof(tcb_t)), alloc_size);107 ALIGN_UP(tls_size, max(tls_align, alignof(tcb_t))) + sizeof(tcb_t); 108 #endif 109 110 void *area = alloc(max(tls_align, alignof(tcb_t)), alloc_size); 110 111 if (!area) 111 112 return NULL; … … 187 188 tls_free_arch(tcb, 188 189 ALIGN_UP(tls->p_memsz, tls->p_align) + sizeof(tcb_t), 189 max(tls->p_align, _Alignof(tcb_t)));190 max(tls->p_align, alignof(tcb_t))); 190 191 } 191 192
Note:
See TracChangeset
for help on using the changeset viewer.