Skip to content

Commit

Permalink
Replace void* with std::byte* in AsyncRuntime
Browse files Browse the repository at this point in the history
Replace void* with std::byte* in AsyncRuntime to make it clear that these pointers point to a memory region.

Reviewed By: ezhulenev

Differential Revision: https://reviews.llvm.org/D140428
  • Loading branch information
yijia1212 authored and ezhulenev committed Dec 21, 2022
1 parent 6761ba7 commit 4109276
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion mlir/include/mlir/ExecutionEngine/AsyncRuntime.h
Expand Up @@ -14,6 +14,7 @@
#ifndef MLIR_EXECUTIONENGINE_ASYNCRUNTIME_H_
#define MLIR_EXECUTIONENGINE_ASYNCRUNTIME_H_

#include <cstddef>
#include <stdint.h>

#ifdef mlir_async_runtime_EXPORTS
Expand All @@ -38,7 +39,7 @@ using AsyncGroup = struct AsyncGroup;
using AsyncValue = struct AsyncValue;

// Async value payload stored in a memory owned by the async.value.
using ValueStorage = void *;
using ValueStorage = std::byte *;

// Async runtime uses LLVM coroutines to represent asynchronous tasks. Task
// function is a coroutine handle and a resume function that continue coroutine
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/ExecutionEngine/AsyncRuntime.cpp
Expand Up @@ -199,7 +199,7 @@ struct AsyncValue : public RefCounted {
std::atomic<State::StateEnum> state;

// Use vector of bytes to store async value payload.
std::vector<int8_t> storage;
std::vector<std::byte> storage;

// Pending awaiters are guarded by a mutex.
std::mutex mu;
Expand Down

0 comments on commit 4109276

Please sign in to comment.