Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
memory: support reallocing foreign (non-Seastar) memory on a reactor …
…thread In general, memory allocated on a reactor thread should come from the Seastar memory allocator. But in certain scenarios, it doesn't. One such example is - seastar built as a shared library - another shared library (openssl) is loaded ahead of seastar and allocates some global storage in its module initializer - seastar loaded, initializes the shard memory allocator - another call into openssl, ends up reallocating the previously allocated memory This crashes in realloc(). Fortunately, swapping the two if statements in that branch is enough to fix the problem, so this patch does just that. Since the second if () is too loose (we can't realloc on a non-reactor thread if the original realloc function is unavailable), it is made unconditional. Closes scylladb#1533
- Loading branch information