apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Gross <ChristianGr...@yahoo.de>
Subject Re: apr_memory_system.c;apr_memory_system.h
Date Wed, 09 May 2001 12:28:06 GMT

I have been following the apr memory thread with great interest and I
think I am missing some point that maybe all of you folks know.  I am
referring to the concept of using shared memory and regular memory as
a "one" pool resource.

Consider the following example...

struct foo {
	void *ptr;

struct foo *myFoo;

myFoo = (struct foo *)apr_shm_malloc( ..);
tmpStruct->ptr = apr_palloc( ...);

or the following could be coded

tmpStruct->ptr = apr_shm_malloc( ...);

The problem here is that you putting both regular memory and shared
memory under one hat.  As a result a programmer could have the
impression that it is regular memory that can be referenced using a
simple pointer.  But the truth is that allocating shared memory and
then using pointers within shared memory is an absolute pain in the
butt.  OR one could use the VC++ compiler with its support of offset
based pointers.  And I suppose everyone is ready to jump to VC++ ;)

Seriously though, how would the use of pointers in structures work
when using shared memory and regular memory allocated from "one" pool

Christian Gross

View raw message