diff options
| author | Stefan Boberg <[email protected]> | 2024-12-02 14:26:11 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2024-12-02 14:26:11 +0100 |
| commit | 9b2fb8069869ec5cea32816a3589d9842595ffea (patch) | |
| tree | 436a21daef8798377f23765e3f022c92f90ba5ac /src/zencore/include | |
| parent | validate that root path exists for workspace before adding it (#250) (diff) | |
| download | zen-9b2fb8069869ec5cea32816a3589d9842595ffea.tar.xz zen-9b2fb8069869ec5cea32816a3589d9842595ffea.zip | |
reduce memory churn (#248)
* eliminated allocation in SetCurrentThreadName
* reduced memory allocator activity in cache RPC response building
* reduced allocations in compact binary building
Diffstat (limited to 'src/zencore/include')
| -rw-r--r-- | src/zencore/include/zencore/compactbinarypackage.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/zencore/include/zencore/compactbinarypackage.h b/src/zencore/include/zencore/compactbinarypackage.h index fe4a60a30..064481f83 100644 --- a/src/zencore/include/zencore/compactbinarypackage.h +++ b/src/zencore/include/zencore/compactbinarypackage.h @@ -172,14 +172,14 @@ public: using AttachmentResolver = std::function<SharedBuffer(const IoHash& Hash)>; /** Construct a null package. */ - CbPackage() = default; + CbPackage(); /** * Construct a package from a root object without gathering attachments. * * @param InObject The root object, which will be cloned unless it is owned. */ - inline explicit CbPackage(CbObject InObject) { SetObject(std::move(InObject)); } + inline explicit CbPackage(CbObject InObject) : CbPackage() { SetObject(std::move(InObject)); } /** * Construct a package from a root object and gather attachments using the resolver. @@ -187,7 +187,10 @@ public: * @param InObject The root object, which will be cloned unless it is owned. * @param InResolver A function that is invoked for every reference and binary reference field. */ - inline explicit CbPackage(CbObject InObject, AttachmentResolver InResolver) { SetObject(std::move(InObject), InResolver); } + inline explicit CbPackage(CbObject InObject, AttachmentResolver InResolver) : CbPackage() + { + SetObject(std::move(InObject), InResolver); + } /** * Construct a package from a root object without gathering attachments. @@ -195,7 +198,7 @@ public: * @param InObject The root object, which will be cloned unless it is owned. * @param InObjectHash The hash of the object, which must match to avoid validation errors. */ - inline explicit CbPackage(CbObject InObject, const IoHash& InObjectHash) { SetObject(std::move(InObject), InObjectHash); } + inline explicit CbPackage(CbObject InObject, const IoHash& InObjectHash) : CbPackage() { SetObject(std::move(InObject), InObjectHash); } /** * Construct a package from a root object and gather attachments using the resolver. @@ -204,7 +207,7 @@ public: * @param InObjectHash The hash of the object, which must match to avoid validation errors. * @param InResolver A function that is invoked for every reference and binary reference field. */ - inline explicit CbPackage(CbObject InObject, const IoHash& InObjectHash, AttachmentResolver InResolver) + inline explicit CbPackage(CbObject InObject, const IoHash& InObjectHash, AttachmentResolver InResolver) : CbPackage() { SetObject(std::move(InObject), InObjectHash, InResolver); } |