summaryrefslogtreecommitdiffstats
path: root/source/core
diff options
context:
space:
mode:
authorkaizhangNV <149626564+kaizhangNV@users.noreply.github.com>2024-06-17 08:41:34 -0700
committerGitHub <noreply@github.com>2024-06-17 08:41:34 -0700
commit93fcb83c34c932c82deeb8a8cd626f0dc990716c (patch)
tree20952609883337228174b1e0301aed5dbdc750cb /source/core
parentf6b3ba88d2ccef03278902cdc86afc8d540c0122 (diff)
Feature/capture (#4397)
* Add the function tailer for appending the output - The basic format for the capture encode is as follow: Header: 4 bytes: magic number ('H' 'E' 'A' 'D' ) 4 bytes: call id - specify the method name 8 bytes: handle id - specify 'this' pointer 8 bytes: payload size in bytes - specify the data size of parameters 8 bytes: thread id Payload: Encode for all the parameters. Tailer (optional): Tailer is an optional, it only used when the output of the method is also stored in the method. Usually it just the opaque handle allocated by slang. 4 bytes: magic number ('T' 'A' 'I' 'L') 4 bytes: payload size in bytes. - Fix some issues in checking the result of write of output stream. * Encoding methods of IGlobalSession Add encoding logic for all the member functions of IGlobalSession, except those query functions that do not impact the internal state of slang. Because some get functions will invoke allocations by slang, these functions are account for the "query functions". Therefore those functions are still captured. All the allocations are stored by using their address, because those allocations are opaque and will finally be used as inputs for other APIs, there is no need to store the data. We just need to track those address and know which APIs will consume them. * Add SLANG_CAPTURE_CHECK macro Add SLANG_CAPTURE_CHECK macro to check SLANG_OK is returned. * Fix build error
Diffstat (limited to 'source/core')
-rw-r--r--source/core/slang-stream.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/core/slang-stream.h b/source/core/slang-stream.h
index a62c18838..8459d53d1 100644
--- a/source/core/slang-stream.h
+++ b/source/core/slang-stream.h
@@ -138,7 +138,7 @@ public:
void setContent(const void* contents, size_t contentsSize)
{
m_ownedContents.setCount(contentsSize);
- if (contentsSize > 0)
+ if (contents != nullptr)
{
::memcpy(m_ownedContents.getBuffer(), contents, contentsSize);
}