<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to RetrieveNoCopy Method</title><link>https://sourceforge.net/p/perfcache/wiki/RetrieveNoCopy%2520Method/</link><description>Recent changes to RetrieveNoCopy Method</description><atom:link href="https://sourceforge.net/p/perfcache/wiki/RetrieveNoCopy%20Method/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 15 Dec 2011 19:38:05 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/perfcache/wiki/RetrieveNoCopy%20Method/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage RetrieveNoCopy Method modified by Glenn Hofford</title><link>https://sourceforge.net/p/perfcache/wiki/RetrieveNoCopy%2520Method/</link><description>&lt;pre&gt;--- v2 
+++ v3 
@@ -35,7 +35,7 @@
 
 RetrieveNoCopy() does a cache retrieve operation, which affects replacement metadata, however it does not copy any data; it simply returns a pointer to the cache entry data, in ppbData.
 
-When used in multi-threaded situations, this is unreliable unless the caller first calls SetCacheEntryDoNotEvictFlag () to mark the cache entry so that it will not be evicted.
+When used in multi-threaded situations, this is unreliable unless the caller first calls SetCacheEntryDoNotEvictFlag () to mark the cache entry so that it will not be evicted. Otherwise, the Retrieve() method should be used, since it copies the data to a buffer that is provided by the caller.
 
 &lt;br /&gt;
 ###### Example ######
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Glenn Hofford</dc:creator><pubDate>Thu, 15 Dec 2011 19:38:05 -0000</pubDate><guid>https://sourceforge.net9f5b8410475bc7f35337a832a0825cdc0e86eea9</guid></item><item><title>WikiPage RetrieveNoCopy Method modified by Glenn Hofford</title><link>https://sourceforge.net/p/perfcache/wiki/RetrieveNoCopy%2520Method/</link><description>&lt;pre&gt;--- v1 
+++ v2 
@@ -2,46 +2,59 @@
 
 ###### Summary: ######
 
-RetrieveNoCopy() retrieves the length in bytes of a cache entry's Document field's data.
-
-&lt;br /&gt;
+RetrieveNoCopy() gets a pointer to the data of a cache entry.
+
+&lt;br /&gt;
 ###### Syntax: ######
 
-    int RetrieveDataLength (const QBYTE *szKey,
-                            size_t *pcbData);
-
-    int RetrieveDataLength (const QWORD *wszKey,
-                            size_t *pcbData);
+    int RetrieveNoCopy (const QBYTE *szKey, 
+                        QBYTE **ppbData);
+
+    int RetrieveNoCopy (const QWORD *wszKey, 
+                        QBYTE **ppbData);
 
 &lt;br /&gt;
 ###### Parameters:######
 
     1) szKey or wszKey: the key
 
-    2) pcbData: pointer to a variable that on return will contain the exact number of bytes of the data that is stored in the cache entry.
+    2) ppbData: pointer to a pointer that on return will point to a buffer containing the data. This buffer is maintained by the cache and must not be deleted or free'd.
 
 &lt;br /&gt;
 ###### Return values:######
 
       E_KEY_INVALIDKEYTYPE
       E_INVALID_KEYVALUE
       E_KEY_NOTFOUND
       E_CACHE_RETRIEVE_ENTRY_MARKED_FOR_DELETION
       E_CACHE_RETRIEVE_ENTRY_IS_EXPIRED
       E_SUCCESS
 
 &lt;br /&gt;
 ###### Remarks:######
 
-RetrieveNoCopy
+RetrieveNoCopy() does a cache retrieve operation, which affects replacement metadata, however it does not copy any data; it simply returns a pointer to the cache entry data, in ppbData.
+
+When used in multi-threaded situations, this is unreliable unless the caller first calls SetCacheEntryDoNotEvictFlag () to mark the cache entry so that it will not be evicted.
 
 &lt;br /&gt;
 ###### Example ######
 
+    // First, get the length in bytes of the data:
+
     size_t cbData = 0;
 
     int iResult = pCache-&gt;RetrieveDataLength ((const QBYTE *) "AAA", // key
                                               &amp;cbData);
+    if (iResult != E_SUCCESS)
+    {
+        // error handling here
+    }
+
+    QBYTE *pbData = NULL;
+
+    iResult = pCache-&gt;RetrieveNoCopy ((const QBYTE *) "AAA", // key
+                                      &amp;pbData);
     if (iResult != E_SUCCESS)
     {
         // error handling here
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Glenn Hofford</dc:creator><pubDate>Thu, 15 Dec 2011 19:36:17 -0000</pubDate><guid>https://sourceforge.net00c85f9412b0779e95cbf152736fac00824c3b77</guid></item><item><title>WikiPage RetrieveNoCopy Method modified by Glenn Hofford</title><link>https://sourceforge.net/p/perfcache/wiki/RetrieveNoCopy%2520Method/</link><description>##### Method: Cache::RetrieveNoCopy #####

###### Summary: ######

RetrieveNoCopy() retrieves the length in bytes of a cache entry's Document field's data.

&lt;br /&gt;
###### Syntax: ######

    int RetrieveDataLength (const QBYTE *szKey,
                            size_t *pcbData);

    int RetrieveDataLength (const QWORD *wszKey,
                            size_t *pcbData);

&lt;br /&gt;
###### Parameters:######

    1) szKey or wszKey: the key

    2) pcbData: pointer to a variable that on return will contain the exact number of bytes of the data that is stored in the cache entry.

&lt;br /&gt;
###### Return values:######

      E_KEY_INVALIDKEYTYPE
      E_INVALID_KEYVALUE
      E_KEY_NOTFOUND
      E_CACHE_RETRIEVE_ENTRY_MARKED_FOR_DELETION
      E_CACHE_RETRIEVE_ENTRY_IS_EXPIRED
      E_SUCCESS

&lt;br /&gt;
###### Remarks:######

RetrieveNoCopy

&lt;br /&gt;
###### Example ######

    size_t cbData = 0;

    int iResult = pCache-&gt;RetrieveDataLength ((const QBYTE *) "AAA", // key
                                              &amp;cbData);
    if (iResult != E_SUCCESS)
    {
        // error handling here
    }
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Glenn Hofford</dc:creator><pubDate>Thu, 15 Dec 2011 19:29:06 -0000</pubDate><guid>https://sourceforge.net5ea9a0cd6b7eb1d1eecbb8a426d282ff9ac9f2ef</guid></item></channel></rss>