You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2009/05/13 20:04:09 UTC
svn commit: r774454 - in /httpd/httpd/trunk: include/ap_slotmem.h
modules/mem/mod_plainmem.c modules/mem/mod_sharedmem.c server/slotmem.c
Author: jim
Date: Wed May 13 18:04:05 2009
New Revision: 774454
URL: http://svn.apache.org/viewvc?rev=774454&view=rev
Log:
ap_slotmem_mem no longer exists. We never provide the ptr to
the actual mem. Instead, we rely solely on getter/setter
Modified:
httpd/httpd/trunk/include/ap_slotmem.h
httpd/httpd/trunk/modules/mem/mod_plainmem.c
httpd/httpd/trunk/modules/mem/mod_sharedmem.c
httpd/httpd/trunk/server/slotmem.c
Modified: httpd/httpd/trunk/include/ap_slotmem.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/ap_slotmem.h?rev=774454&r1=774453&r2=774454&view=diff
==============================================================================
--- httpd/httpd/trunk/include/ap_slotmem.h (original)
+++ httpd/httpd/trunk/include/ap_slotmem.h Wed May 13 18:04:05 2009
@@ -101,14 +101,6 @@
*/
apr_status_t (* slotmem_attach)(ap_slotmem_t **new, const char *name, apr_size_t *item_size, unsigned int *item_num, apr_pool_t *pool);
/**
- * get the memory ptr associated with this worker slot.
- * @param s ap_slotmem_t to use.
- * @param item_id item to return for 0 to item_num
- * @param mem address to store the pointer to the slot
- * @return APR_SUCCESS if all went well
- */
- apr_status_t (* slotmem_mem)(ap_slotmem_t *s, unsigned int item_id, void**mem);
- /**
* retrieve the memory associated with this worker slot.
* @param s ap_slotmem_t to use.
* @param item_id item to return for 0 to item_num
@@ -198,15 +190,6 @@
*/
AP_DECLARE(apr_status_t) ap_slotmem_attach(ap_slotmem_storage_method *sm, ap_slotmem_t **new, const char *name, apr_size_t *item_size, unsigned int *item_num, apr_pool_t *pool);
/**
- * get the memory associated with this worker slot.
- * @param sm ap_slotmem_storage_method provider obtained
- * @param s ap_slotmem_t to use.
- * @param item_id item to return for 0 to item_num
- * @param mem address to store the pointer to the slot
- * @return APR_SUCCESS if all went well
- */
-AP_DECLARE(apr_status_t) ap_slotmem_mem(ap_slotmem_storage_method *sm, ap_slotmem_t *s, unsigned int item_id, void**mem);
-/**
* retrieve the memory associated with this worker slot.
* @param sm ap_slotmem_storage_method provider obtained
* @param s ap_slotmem_t to use.
Modified: httpd/httpd/trunk/modules/mem/mod_plainmem.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mem/mod_plainmem.c?rev=774454&r1=774453&r2=774454&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/mem/mod_plainmem.c (original)
+++ httpd/httpd/trunk/modules/mem/mod_plainmem.c Wed May 13 18:04:05 2009
@@ -192,7 +192,6 @@
&slotmem_do,
&slotmem_create,
&slotmem_attach,
- &slotmem_mem,
&slotmem_get,
&slotmem_put,
&slotmem_num_slots,
Modified: httpd/httpd/trunk/modules/mem/mod_sharedmem.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mem/mod_sharedmem.c?rev=774454&r1=774453&r2=774454&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/mem/mod_sharedmem.c (original)
+++ httpd/httpd/trunk/modules/mem/mod_sharedmem.c Wed May 13 18:04:05 2009
@@ -492,7 +492,6 @@
&slotmem_do,
&slotmem_create,
&slotmem_attach,
- &slotmem_mem,
&slotmem_get,
&slotmem_put,
&slotmem_num_slots,
Modified: httpd/httpd/trunk/server/slotmem.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/slotmem.c?rev=774454&r1=774453&r2=774454&view=diff
==============================================================================
--- httpd/httpd/trunk/server/slotmem.c (original)
+++ httpd/httpd/trunk/server/slotmem.c Wed May 13 18:04:05 2009
@@ -56,12 +56,6 @@
return (sm->slotmem_attach(new, name, item_size, item_num, pool));
}
-AP_DECLARE(apr_status_t) ap_slotmem_mem(ap_slotmem_storage_method *sm,
- ap_slotmem_t *s, unsigned int item_id, void**mem)
-{
- return (sm->slotmem_mem(s, item_id, mem));
-}
-
AP_DECLARE(apr_status_t) ap_slotmem_get(ap_slotmem_storage_method *sm,
ap_slotmem_t *s, unsigned int item_id,
unsigned char *dest, apr_size_t dest_len)
Re: svn commit: r774454 - in /httpd/httpd/trunk: include/ap_slotmem.h
modules/mem/mod_plainmem.c modules/mem/mod_sharedmem.c server/slotmem.c
Posted by jean-frederic clere <jf...@gmail.com>.
Jim Jagielski wrote:
>
> On May 14, 2009, at 10:16 AM, Jim Jagielski wrote:
>
>>
>> On May 14, 2009, at 2:33 AM, jean-frederic clere wrote:
>>> Thanks.
>>> The idea of ap_slotmem_mem is to provide an address in the shared
>>> area that can be used for example like the proxy_worker_stat. Using
>>> get/put would require 2 memcpy.... I hate memcpy :)
>>>
>>
>> This is true... Updating would require a memcpy to read in and a memcpy
>> to update, whereas having a pointer means we can adjust the slot
>> as is (at most, one memcpy). Most slots would need to return APR_ENOTIMPL
>> because a concept of a "pointer to a slot" doesn't make sense.
>>
>
> Hmmmm maybe instead of slotmem_mem we call it slotmem_dptr (for
> direct-pointer),
> to make it clearer?? SQL-based slots, for example, would not have a
> dptr and would return APR_ENOTIMPL.
>
+1. Good names help :-)
Cheers
Jean-Frederic
Re: svn commit: r774454 - in /httpd/httpd/trunk: include/ap_slotmem.h modules/mem/mod_plainmem.c modules/mem/mod_sharedmem.c server/slotmem.c
Posted by Jim Jagielski <ji...@jaguNET.com>.
On May 14, 2009, at 10:16 AM, Jim Jagielski wrote:
>
> On May 14, 2009, at 2:33 AM, jean-frederic clere wrote:
>> Thanks.
>> The idea of ap_slotmem_mem is to provide an address in the shared
>> area that can be used for example like the proxy_worker_stat. Using
>> get/put would require 2 memcpy.... I hate memcpy :)
>>
>
> This is true... Updating would require a memcpy to read in and a
> memcpy
> to update, whereas having a pointer means we can adjust the slot
> as is (at most, one memcpy). Most slots would need to return
> APR_ENOTIMPL
> because a concept of a "pointer to a slot" doesn't make sense.
>
Hmmmm maybe instead of slotmem_mem we call it slotmem_dptr (for direct-
pointer),
to make it clearer?? SQL-based slots, for example, would not have a
dptr and would return APR_ENOTIMPL.
Re: svn commit: r774454 - in /httpd/httpd/trunk: include/ap_slotmem.h modules/mem/mod_plainmem.c modules/mem/mod_sharedmem.c server/slotmem.c
Posted by Jim Jagielski <ji...@jaguNET.com>.
On May 14, 2009, at 2:33 AM, jean-frederic clere wrote:
> Jim Jagielski wrote:
>> On May 13, 2009, at 3:40 PM, Jim Jagielski wrote:
>>>
>>> On May 13, 2009, at 3:22 PM, jean-frederic clere wrote:
>>>
>>>> jim@apache.org wrote:
>>>>> Author: jim
>>>>> Date: Wed May 13 18:04:05 2009
>>>>> New Revision: 774454
>>>>> URL: http://svn.apache.org/viewvc?rev=774454&view=rev
>>>>> Log:
>>>>> ap_slotmem_mem no longer exists. We never provide the ptr to
>>>>> the actual mem. Instead, we rely solely on getter/setter
>>>>
>>>> Why? I am using it :-(
>>>>
>>>
>>> Oops! Sorry. We can add it back in... But what does
>>> ap_slotmem_mem provide that ap_slotmem_get/ap_slotmem_put?
>>> Again, the idea is that we abstract out the memory handling.
>>> So why do you need the memory pointer if you have a getter and
>>> setter which handles accessing... But no prob putting it back.
>>>
>> patch reverted
>
> Thanks.
> The idea of ap_slotmem_mem is to provide an address in the shared
> area that can be used for example like the proxy_worker_stat. Using
> get/put would require 2 memcpy.... I hate memcpy :)
>
This is true... Updating would require a memcpy to read in and a memcpy
to update, whereas having a pointer means we can adjust the slot
as is (at most, one memcpy). Most slots would need to return
APR_ENOTIMPL
because a concept of a "pointer to a slot" doesn't make sense.
Re: svn commit: r774454 - in /httpd/httpd/trunk: include/ap_slotmem.h
modules/mem/mod_plainmem.c modules/mem/mod_sharedmem.c server/slotmem.c
Posted by jean-frederic clere <jf...@gmail.com>.
Jim Jagielski wrote:
>
> On May 13, 2009, at 3:40 PM, Jim Jagielski wrote:
>
>>
>> On May 13, 2009, at 3:22 PM, jean-frederic clere wrote:
>>
>>> jim@apache.org wrote:
>>>> Author: jim
>>>> Date: Wed May 13 18:04:05 2009
>>>> New Revision: 774454
>>>> URL: http://svn.apache.org/viewvc?rev=774454&view=rev
>>>> Log:
>>>> ap_slotmem_mem no longer exists. We never provide the ptr to
>>>> the actual mem. Instead, we rely solely on getter/setter
>>>
>>> Why? I am using it :-(
>>>
>>
>> Oops! Sorry. We can add it back in... But what does
>> ap_slotmem_mem provide that ap_slotmem_get/ap_slotmem_put?
>> Again, the idea is that we abstract out the memory handling.
>> So why do you need the memory pointer if you have a getter and
>> setter which handles accessing... But no prob putting it back.
>>
>
> patch reverted
Thanks.
The idea of ap_slotmem_mem is to provide an address in the shared area
that can be used for example like the proxy_worker_stat. Using get/put
would require 2 memcpy.... I hate memcpy :)
Cheers
Jean-Frederic
>
Re: svn commit: r774454 - in /httpd/httpd/trunk: include/ap_slotmem.h modules/mem/mod_plainmem.c modules/mem/mod_sharedmem.c server/slotmem.c
Posted by Jim Jagielski <ji...@jaguNET.com>.
On May 13, 2009, at 3:40 PM, Jim Jagielski wrote:
>
> On May 13, 2009, at 3:22 PM, jean-frederic clere wrote:
>
>> jim@apache.org wrote:
>>> Author: jim
>>> Date: Wed May 13 18:04:05 2009
>>> New Revision: 774454
>>> URL: http://svn.apache.org/viewvc?rev=774454&view=rev
>>> Log:
>>> ap_slotmem_mem no longer exists. We never provide the ptr to
>>> the actual mem. Instead, we rely solely on getter/setter
>>
>> Why? I am using it :-(
>>
>
> Oops! Sorry. We can add it back in... But what does
> ap_slotmem_mem provide that ap_slotmem_get/ap_slotmem_put?
> Again, the idea is that we abstract out the memory handling.
> So why do you need the memory pointer if you have a getter and
> setter which handles accessing... But no prob putting it back.
>
patch reverted
Re: svn commit: r774454 - in /httpd/httpd/trunk: include/ap_slotmem.h modules/mem/mod_plainmem.c modules/mem/mod_sharedmem.c server/slotmem.c
Posted by Jim Jagielski <ji...@jaguNET.com>.
On May 13, 2009, at 3:22 PM, jean-frederic clere wrote:
> jim@apache.org wrote:
>> Author: jim
>> Date: Wed May 13 18:04:05 2009
>> New Revision: 774454
>> URL: http://svn.apache.org/viewvc?rev=774454&view=rev
>> Log:
>> ap_slotmem_mem no longer exists. We never provide the ptr to
>> the actual mem. Instead, we rely solely on getter/setter
>
> Why? I am using it :-(
>
Oops! Sorry. We can add it back in... But what does
ap_slotmem_mem provide that ap_slotmem_get/ap_slotmem_put?
Again, the idea is that we abstract out the memory handling.
So why do you need the memory pointer if you have a getter and
setter which handles accessing... But no prob putting it back.
Re: svn commit: r774454 - in /httpd/httpd/trunk: include/ap_slotmem.h
modules/mem/mod_plainmem.c modules/mem/mod_sharedmem.c server/slotmem.c
Posted by jean-frederic clere <jf...@gmail.com>.
jim@apache.org wrote:
> Author: jim
> Date: Wed May 13 18:04:05 2009
> New Revision: 774454
>
> URL: http://svn.apache.org/viewvc?rev=774454&view=rev
> Log:
> ap_slotmem_mem no longer exists. We never provide the ptr to
> the actual mem. Instead, we rely solely on getter/setter
Why? I am using it :-(
Cheers
Jean-Frederic