| 7515 | } |
| 7516 | |
| 7517 | static void *bf_aligned_malloc(bf_context_t *s, size_t size, size_t align) |
| 7518 | { |
| 7519 | void *ptr; |
| 7520 | void **ptr1; |
| 7521 | ptr = bf_malloc(s, size + sizeof(void *) + align - 1); |
| 7522 | if (!ptr) |
| 7523 | return NULL; |
| 7524 | ptr1 = (void **)(((uintptr_t)ptr + sizeof(void *) + align - 1) & |
| 7525 | ~(align - 1)); |
| 7526 | ptr1[-1] = ptr; |
| 7527 | return ptr1; |
| 7528 | } |
| 7529 | |
| 7530 | static void bf_aligned_free(bf_context_t *s, void *ptr) |
| 7531 | { |
no test coverage detected