From f0d40ad5e1d0a0dec39fe8a141d3f81d88fc576a Mon Sep 17 00:00:00 2001 From: kaizhangNV <149626564+kaizhangNV@users.noreply.github.com> Date: Thu, 13 Jun 2024 13:02:12 -0700 Subject: capture/replay: implement infrastructure for capture (#4372) * Define api call ID for each being captured methods * Add parameter encoder interface * Add outputStream and capture manager Add infrastructure for output stream This is the interface to record the method and parameter, and also provide functionality to write all the serialized data into file. Add capture manager: Capture manager is associated to global session object, it will provide the functionality to actual record all the APIs. Implement some of parameter encoder functions. * Fix some Windows & cmake build error * remove unused headers --- source/core/slang-stream.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/core') diff --git a/source/core/slang-stream.h b/source/core/slang-stream.h index 9f405dbb0..a62c18838 100644 --- a/source/core/slang-stream.h +++ b/source/core/slang-stream.h @@ -138,7 +138,10 @@ public: void setContent(const void* contents, size_t contentsSize) { m_ownedContents.setCount(contentsSize); - ::memcpy(m_ownedContents.getBuffer(), contents, contentsSize); + if (contentsSize > 0) + { + ::memcpy(m_ownedContents.getBuffer(), contents, contentsSize); + } _setContents(m_ownedContents.getBuffer(), m_ownedContents.getCount()); } -- cgit v1.2.3