Return-Path: Delivered-To: apmail-apr-cvs-archive@apr.apache.org Received: (qmail 29139 invoked by uid 500); 25 May 2002 20:17:46 -0000 Mailing-List: contact cvs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: dev@apr.apache.org Delivered-To: mailing list cvs@apr.apache.org Received: (qmail 29128 invoked from network); 25 May 2002 20:17:46 -0000 Date: 25 May 2002 20:17:45 -0000 Message-ID: <20020525201745.95807.qmail@icarus.apache.org> From: jwoolley@apache.org To: apr-cvs@apache.org Subject: cvs commit: apr/include apr_pools.h X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N jwoolley 02/05/25 13:17:45 Modified: include apr_pools.h Log: Fair warning, as this keeps coming up over and over. We're not using apr_pool_userdata_setn() anymore as far as I can tell, because anywhere that we used it was later deemed unsafe for one reason or another. Is it wise to have it in the API at all? I suppose it has value, but knowing when it's safe to use it can be tricky. Revision Changes Path 1.93 +8 -2 apr/include/apr_pools.h Index: apr_pools.h =================================================================== RCS file: /home/cvs/apr/include/apr_pools.h,v retrieving revision 1.92 retrieving revision 1.93 diff -u -d -u -r1.92 -r1.93 --- apr_pools.h 10 May 2002 14:03:29 -0000 1.92 +++ apr_pools.h 25 May 2002 20:17:45 -0000 1.93 @@ -488,8 +488,14 @@ * @note same as apr_pool_userdata_set(), except that this version doesn't * make a copy of the key (this function is useful, for example, when * the key is a string literal) - * @warning The key and the data to be attached to the pool should have - * a life span at least as long as the pool itself. + * @warning This should NOT be used if the key could change addresses by + * any means between the apr_pool_userdata_setn() call and a + * subsequent apr_pool_userdata_get() on that key, such as if a + * static string is used as a userdata key in a DSO and the DSO could + * be unloaded and reloaded between the _setn() and the _get(). You + * MUST use apr_pool_userdata_set() in such cases. + * @warning More generally, the key and the data to be attached to the + * pool should have a life span at least as long as the pool itself. * */ APR_DECLARE(apr_status_t) apr_pool_userdata_setn(