[ 
https://issues.apache.org/jira/browse/PROTON-2140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16979591#comment-16979591
 ] 

ASF GitHub Bot commented on PROTON-2140:
----------------------------------------

astitcher commented on pull request #213: PROTON-2140: Lazy creation of various 
link related objects
URL: https://github.com/apache/qpid-proton/pull/213#discussion_r349295184
 
 

 ##########
 File path: c/src/core/engine.c
 ##########
 @@ -2123,38 +2124,52 @@ pn_condition_t *pn_link_remote_condition(pn_link_t 
*link)
 
 bool pn_condition_is_set(pn_condition_t *condition)
 {
-  return condition && pn_string_get(condition->name);
+  return condition && condition->name && pn_string_get(condition->name);
 }
 
 void pn_condition_clear(pn_condition_t *condition)
 {
   assert(condition);
-  pn_string_clear(condition->name);
-  pn_string_clear(condition->description);
+  if (condition->name) pn_string_clear(condition->name);
+  if (condition->description) pn_string_clear(condition->description);
   pn_data_clear(condition->info);
 }
 
 const char *pn_condition_get_name(pn_condition_t *condition)
 {
   assert(condition);
-  return pn_string_get(condition->name);
+  if (condition->name == NULL) {
+    return 0;
+  } else {
+    return pn_string_get(condition->name);
+  }
 }
 
 int pn_condition_set_name(pn_condition_t *condition, const char *name)
 {
   assert(condition);
+  if (condition->name == NULL) {
+    condition->name = pn_string(NULL);
 
 Review comment:
   You can use `pn_string(name); return;` here and avoid the next string 
operation.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> proton-c has very high memory footprint for links
> -------------------------------------------------
>
>                 Key: PROTON-2140
>                 URL: https://issues.apache.org/jira/browse/PROTON-2140
>             Project: Qpid Proton
>          Issue Type: Improvement
>            Reporter: Gordon Sim
>            Priority: Major
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to