瀏覽代碼

HPCC-17064 UDP code is passing large objects around

I suspect in fact the situation was not as bad as Coverity made it sound - the
object is passed by value but the copy-constructor actually avoids copying
most of the data. But still better to pass by reference here.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 8 年之前
父節點
當前提交
a55061ea78
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      roxie/udplib/udpsha.hpp

+ 4 - 4
roxie/udplib/udpsha.hpp

@@ -88,8 +88,8 @@ public:
 
 
 template < class _et >
-class simple_queue {
-    
+class simple_queue
+{
     _et             *elements;
     unsigned int    element_count;
     int             first;
@@ -100,7 +100,7 @@ class simple_queue {
     Semaphore       free_space;
     
 public: 
-    void push(_et element) 
+    void push(const _et &element)
     {
         free_space.wait();
         c_region.enter();
@@ -112,7 +112,7 @@ public:
         data_avail.signal();
     }
     
-    bool push(_et element,long timeout) 
+    bool push(const _et &element,long timeout)
     {
         if (free_space.wait(timeout) ) {
             c_region.enter();