[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1683126 - /subversion/trunk/subversion/libsvn_fs_x/cached_data.c

From: Bert Huijben <bert_at_qqmail.nl>
Date: Tue, 2 Jun 2015 16:30:55 +0000

Strange… this should never be necessarily when *removing* something from a hash (value =NULL).


I think you see some kind of other problem.


Bert






Sent from Surface





From: Philip Martin
Sent: ‎Tuesday‎, ‎June‎ ‎2‎, ‎2015 ‎5‎:‎19‎ ‎PM
To: commits_at_subversion.apache.org





Author: philip
Date: Tue Jun 2 15:19:26 2015
New Revision: 1683126

URL: http://svn.apache.org/r1683126
Log:
Avoid using pool memory after clear in FSX.

* subversion/libsvn_fs_x/cached_data.c
  (read_dir_entries): Copy hashed values into hash pool.

Modified:
    subversion/trunk/subversion/libsvn_fs_x/cached_data.c

Modified: subversion/trunk/subversion/libsvn_fs_x/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_x/cached_data.c?rev=1683126&r1=1683125&r2=1683126&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_x/cached_data.c (original)
+++ subversion/trunk/subversion/libsvn_fs_x/cached_data.c Tue Jun 2 15:19:26 2015
@@ -2494,7 +2494,9 @@ read_dir_entries(apr_array_header_t *ent
         {
           /* We must be in incremental mode */
           assert(hash);
- apr_hash_set(hash, entry.key, entry.keylen, NULL);
+ apr_hash_set(hash,
+ apr_pstrmemdup(scratch_pool, entry.key, entry.keylen),
+ entry.keylen, NULL);
           continue;
         }
 
@@ -2534,7 +2536,9 @@ read_dir_entries(apr_array_header_t *ent
       /* In incremental mode, update the hash; otherwise, write to the
        * final array. */
       if (incremental)
- apr_hash_set(hash, entry.key, entry.keylen, dirent);
+ apr_hash_set(hash,
+ apr_pstrmemdup(scratch_pool, entry.key, entry.keylen),
+ entry.keylen, dirent);
       else
         APR_ARRAY_PUSH(entries, svn_fs_x__dirent_t *) = dirent;
     }
Received on 2015-06-02 18:32:38 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.