<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Free memory inside the enclave in Intel® Software Guard Extensions (Intel® SGX)</title>
    <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Free-memory-inside-the-enclave/m-p/1298658#M4752</link>
    <description>&lt;P&gt;Thanks for your reply! Got it.&lt;/P&gt;</description>
    <pubDate>Wed, 14 Jul 2021 22:40:11 GMT</pubDate>
    <dc:creator>DylanWang</dc:creator>
    <dc:date>2021-07-14T22:40:11Z</dc:date>
    <item>
      <title>Free memory inside the enclave</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Free-memory-inside-the-enclave/m-p/1295555#M4714</link>
      <description>&lt;P&gt;Hi, Team.&lt;/P&gt;
&lt;P&gt;I'm new to SGX.&lt;/P&gt;
&lt;P&gt;I'm not that familiar with the memory management inside the enclave.&lt;/P&gt;
&lt;P&gt;Since I use the C++11 feature (like&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;unique_ptr&lt;/SPAN&gt;) and class objects in my sample code, how should I free memory? For class objects, some other objects are embedded.&lt;/P&gt;
&lt;P&gt;Sample code:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;test.h&lt;/STRONG&gt;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;class{&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;private:&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; ClassA&lt;/SPAN&gt;&lt;SPAN&gt;* ca&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; unique_ptr&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;ClassB&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;cb&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; unique_ptr&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;ClassC&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;cc&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;test.cpp&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;ca = new ClassA*(...); // delete?&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;cb = make_unique&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;ClassB&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;(function(...)&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;cc =&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit;"&gt;make_unique&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit;"&gt;&amp;lt;&lt;SPAN&gt;ClassC&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: inherit;"&gt;&amp;gt;&lt;SPAN&gt;(function(...)&lt;/SPAN&gt;&lt;SPAN&gt;); // Do I need to do something for this smart pointer?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 22:36:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Free-memory-inside-the-enclave/m-p/1295555#M4714</guid>
      <dc:creator>DylanWang</dc:creator>
      <dc:date>2021-07-02T22:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Free memory inside the enclave</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Free-memory-inside-the-enclave/m-p/1296392#M4718</link>
      <description>&lt;P&gt;Hello DylanWang,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use &lt;SPAN style="font-family: courier;"&gt;delete&lt;/SPAN&gt; to free up memory from the class and unique_ptrs just as you would in non-enclave code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Refer to the SGX SDK Developer Reference Guide for your OS, section C++ Language Support, for more information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sincerely,&lt;/P&gt;
&lt;P&gt;Jesus G.&lt;/P&gt;
&lt;P&gt;Intel Customer Support&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jul 2021 20:30:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Free-memory-inside-the-enclave/m-p/1296392#M4718</guid>
      <dc:creator>JesusG_Intel</dc:creator>
      <dc:date>2021-07-06T20:30:51Z</dc:date>
    </item>
    <item>
      <title>Re:Free memory inside the enclave</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Free-memory-inside-the-enclave/m-p/1297442#M4738</link>
      <description>&lt;P&gt;&lt;B&gt;This thread has been marked as answered and Intel will no longer monitor this thread. If you want a response from Intel in a follow-up question, please open a new thread.&lt;/B&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 09 Jul 2021 21:25:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Free-memory-inside-the-enclave/m-p/1297442#M4738</guid>
      <dc:creator>JesusG_Intel</dc:creator>
      <dc:date>2021-07-09T21:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: Free memory inside the enclave</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Free-memory-inside-the-enclave/m-p/1298658#M4752</link>
      <description>&lt;P&gt;Thanks for your reply! Got it.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 22:40:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Free-memory-inside-the-enclave/m-p/1298658#M4752</guid>
      <dc:creator>DylanWang</dc:creator>
      <dc:date>2021-07-14T22:40:11Z</dc:date>
    </item>
  </channel>
</rss>

