httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lee Fellows <lfell...@4lane.com>
Subject Re: Problem allocating memory
Date Thu, 16 May 2002 17:24:03 GMT

Pierre,

  Have you tried printing out the value of one.var before the call to
ap_palloc and then immediately afterword?

  That would narrow down the possible sources of trouble.  If one.var
== "Hello" both before and immediately after the call, then the problem
lies elsewhere in your code.

  Also, determine what the value of two.var is before the call to 
ap_palloc.  Should be null, but if it is pointing at one.var's value
something is amiss.


On Thu, 2002-05-16 at 12:41, Pierre Leplay wrote:
> Hi,
> 
> 
> I have a problem with the memory. I try to explain my problem with the
> following line of code:
> 
> struct {
> 	char var[20];
> }myStruct1;
> myStruct1 one;
> 
> struct{
> 	char *var;
> }myStruct2;
> myStruct2 two;
> 
> 
> 
> void init(){
> 	strcpy(one.var,"Hello");
> 	//one.var=hello
> 
> 	two.var=(char
> *)ap_palloc(archi_prox_pool,(strlen("Hello2")+1)*sizeof(char));
> 	//ap_palloc overwrite one.var (one.var and two.var).
> 	...
> }
> 
> 	Is someone have the same problem? The problem come of an another
> part of my program ? The problem come to my ressource pool ?
> 
> Thanks,
> 
> P.Leplay	
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message