diff options
Diffstat (limited to 'clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp')
-rw-r--r-- | clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp b/clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp index 6d7d69da4db..114d0815ba4 100644 --- a/clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp +++ b/clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp @@ -184,10 +184,11 @@ void DirectoryWatcherLinux::InotifyPollingLoop() { // the inotify file descriptor should have the same alignment as // struct inotify_event. - auto ManagedBuffer = - llvm::make_unique<llvm::AlignedCharArray<alignof(struct inotify_event), - EventBufferLength>>(); - char *const Buf = ManagedBuffer->buffer; + struct Buffer { + alignas(struct inotify_event) char buffer[EventBufferLength]; + }; + auto ManagedBuffer = llvm::make_unique<Buffer>(); + char *const Buf = ManagedBuffer.buffer; const int EpollFD = epoll_create1(EPOLL_CLOEXEC); if (EpollFD == -1) { @@ -350,4 +351,4 @@ std::unique_ptr<DirectoryWatcher> clang::DirectoryWatcher::create( return llvm::make_unique<DirectoryWatcherLinux>( Path, Receiver, WaitForInitialSync, InotifyFD, InotifyWD, std::move(*InotifyPollingStopper)); -}
\ No newline at end of file +} |