[prev in list] [next in list] [prev in thread] [next in thread] 

List:       subversion-dev
Subject:    =?utf-8?Q?Re:_svn_commit:_r1543985_-_in_/subversion/trunk/subversion/bind?= =?utf-8?Q?ings/javahl:_n
From:       Bert_Huijben <bert () qqmail ! nl>
Date:       2013-11-21 2:11:48
Message-ID: 528d6dca.45b00e0a.4d6d.ffffc51d () mx ! google ! com
[Download RAW message or body]

[Attachment #2 (text/plain)]

Branko,


I might have found the cause of the error. See snippet below


Bert





Sent from Windows Mail





From: Branko Čibej
Sent: ‎Thursday‎, ‎November‎ ‎21‎, ‎2013 ‎12‎:‎43‎ ‎AM
To: commits@subversion.apache.org


+class KeywordHashBuilder
+{
+public:
+  explicit KeywordHashBuilder(const SVN::Pool& pool)
+    : m_pool(pool),
+      m_hash(apr_hash_make(pool.getPool()))
+    {}
+
+  void operator()(const std::string& key, const Java::ByteArray& value)
+    {
+      Java::ByteArray::Contents val(value);
+      apr_hash_set(m_hash, key.c_str(), key.size(), val.get_string(m_pool));
+    }

<<<<<<<

The key must be duplicated in the pool, or hash lookups will look into memory with \
unknown lifetime when they compare the key.

<<<<<<<


+
+  apr_hash_t* get() const
+    {
+      return m_hash;
+    }
+
+private:
+  const SVN::Pool& m_pool;
+  apr_hash_t* const m_hash;
+};
+


[Attachment #3 (text/html)]


<html>
<head>
<meta name="generator" content="Windows Mail 17.5.9600.20279">
<style type="text/css"><!--html { font-family: "Color Emoji", "Calibri", "Segoe UI", \
"Meiryo", "Microsoft YaHei UI", "Microsoft JhengHei UI", "Malgun Gothic", \
"sans-serif"; }--></style><style data-externalstyle="true"><!-- p.MsoListParagraph, \
li.MsoListParagraph, div.MsoListParagraph { margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
}
p.MsoNormal, li.MsoNormal, div.MsoNormal {
margin:0in;
margin-bottom:.0001pt;
}
p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, \
div.MsoListParagraphCxSpFirst,  p.MsoListParagraphCxSpMiddle, \
li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle,  \
p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast \
{ margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
line-height:115%;
}
--></style></head>
<body dir="ltr">
<div data-externalstyle="false" dir="ltr" style="font-family: 'Calibri', 'Segoe UI', \
'Meiryo', 'Microsoft YaHei UI', 'Microsoft JhengHei UI', 'Malgun Gothic', \
'sans-serif';font-size:12pt;"><div style="margin-right: 0px;" \
dir="ltr">Branko,</div><div style="margin-right: 0px;" dir="ltr"><br></div><div \
style="margin-right: 0px;" dir="ltr">I might have found the cause of the error. See \
snippet below</div><div style="margin-right: 0px;" dir="ltr"><br></div><div \
style="margin-right: 0px;" dir="ltr">Bert<br></div><div \
data-signatureblock="true"><br></div><div data-signatureblock="true">Sent from \
Windows Mail</div><div data-signatureblock="true"><br></div><div style="padding-top: \
5px; border-top-color: rgb(229, 229, 229); border-top-width: 1px; border-top-style: \
solid;"><div><font face=" 'Calibri', 'Segoe UI', 'Meiryo', 'Microsoft YaHei UI', \
'Microsoft JhengHei UI', 'Malgun Gothic', 'sans-serif'" style='line-height: 15pt; \
letter-spacing: 0.02em; font-family: "Calibri", "Segoe UI", "Meiryo", "Microsoft \
YaHei UI", "Microsoft JhengHei UI", "Malgun Gothic", "sans-serif"; font-size: \
12pt;'><b>From:</b>&nbsp;<a href="mailto:brane@apache.org" target="_parent">Branko \
Čibej</a><br><b>Sent:</b>&nbsp;‎Thursday‎, ‎November‎ ‎21‎, ‎2013 \
‎12‎:‎43‎ ‎AM<br><b>To:</b>&nbsp;<a \
href="mailto:commits@subversion.apache.org" \
target="_parent">commits@subversion.apache.org</a></font></div></div><div><br>+class \
KeywordHashBuilder<br>+{<br>+public:<br>+&nbsp; explicit KeywordHashBuilder(const \
SVN::Pool&amp; pool)<br>+&nbsp;&nbsp;&nbsp; : \
m_pool(pool),<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
m_hash(apr_hash_make(pool.getPool()))<br>+&nbsp;&nbsp;&nbsp; {}<br>+<br>+&nbsp; void \
operator()(const std::string&amp; key, const Java::ByteArray&amp; \
value)<br>+&nbsp;&nbsp;&nbsp; {<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
Java::ByteArray::Contents val(value);<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
apr_hash_set(m_hash, key.c_str(), key.size(), \
val.get_string(m_pool));<br>+&nbsp;&nbsp;&nbsp; \
}</div><div>&lt;&lt;&lt;&lt;&lt;&lt;&lt;</div><div>The key must be duplicated in the \
pool, or hash lookups will look into memory with unknown lifetime when they compare \
the key.</div><div>&lt;&lt;&lt;&lt;&lt;&lt;&lt;</div><div><br>+<br>+&nbsp; \
apr_hash_t* get() const<br>+&nbsp;&nbsp;&nbsp; {<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
return m_hash;<br>+&nbsp;&nbsp;&nbsp; }<br>+<br>+private:<br>+&nbsp; const \
SVN::Pool&amp; m_pool;<br>+&nbsp; apr_hash_t* const \
m_hash;<br>+};<br>+<br><br></div></div> </body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic