<p>George Joseph <strong>posted comments</strong> on this change.</p><p><a href="https://gerrit.asterisk.org/8604">View Change</a></p><p>Patch set 2:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p>(12 comments)</p><ul style="list-style: none; padding-left: 20px;"><li><p><a href="https://gerrit.asterisk.org/#/c/8604/2/include/asterisk/data_buffer.h">File include/asterisk/data_buffer.h:</a></p><ul style="list-style: none; padding-left: 20px;"><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8604/2/include/asterisk/data_buffer.h@36">Patch Set #2, Line 36:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">/*!<br> * \brief The number of cached payloads a data buffer starts out with<br> */<br>#define CACHED_PAYLOADS_START 2<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Since it's used only internally by the data_buffer, this should probably be moved to data_buffer.c</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8604/2/include/asterisk/data_buffer.h@56">Patch Set #2, Line 56:</a> <code style="font-family:monospace,monospace">\param free_fn Callback function to free a data payload</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Might need to allow a NULL callback so a caller can do their own memory management.</p></li></ul></li><li><p><a href="https://gerrit.asterisk.org/#/c/8604/2/main/data_buffer.c">File main/data_buffer.c:</a></p><ul style="list-style: none; padding-left: 20px;"><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8604/2/main/data_buffer.c@38">Patch Set #2, Line 38:</a> <code style="font-family:monospace,monospace"> vector</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">No vector.</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8604/2/main/data_buffer.c@40">Patch Set #2, Line 40:</a> <code style="font-family:monospace,monospace">data_buffer_payload</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I'd rename this to payload_list_entry or something.  It's the wrapper for the payload, not the payload itself.</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8604/2/main/data_buffer.c@44">Patch Set #2, Line 44:</a> <code style="font-family:monospace,monospace">int</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Since pos is an arbitrary number assigned by the caller it should probably be a size_t.</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8604/2/main/data_buffer.c@70">Patch Set #2, Line 70:</a> <code style="font-family:monospace,monospace">int</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">size_t</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8604/2/main/data_buffer.c@136">Patch Set #2, Line 136:</a> <code style="font-family:monospace,monospace">     ast_assert(free_fn != NULL);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">You should allow this to be NULL so a caller can do it's own memory management if it needs to.</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8604/2/main/data_buffer.c@185">Patch Set #2, Line 185:</a> <code style="font-family:monospace,monospace">                            buffer->free_fn(existing_payload->payload);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Check for NULL free_fn</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8604/2/main/data_buffer.c@198">Patch Set #2, Line 198:</a> <code style="font-family:monospace,monospace">int</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">size_t</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8604/2/main/data_buffer.c@212">Patch Set #2, Line 212:</a> <code style="font-family:monospace,monospace">            buffer->free_fn(buffer_payload->payload);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Check for NULL free_fn</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8604/2/main/data_buffer.c@254">Patch Set #2, Line 254:</a> <code style="font-family:monospace,monospace">int</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">size_t</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/8604/2/main/data_buffer.c@284">Patch Set #2, Line 284:</a> <code style="font-family:monospace,monospace">              buffer->free_fn(buffer_payload->payload);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Check for NULL free_fn</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/8604">change 8604</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/8604"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: Iff13c5d4795d52356959fe2a57360cd57dfade07 </div>
<div style="display:none"> Gerrit-Change-Number: 8604 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 20 Mar 2018 11:47:27 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>