httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dirk.vanGulik" <>
Subject set_flag and memory
Date Thu, 06 Jun 1996 05:41:35 GMT
q: Would it be an idea to have a global errstr or something
   which you can sprintf to, a lot of modules seem to claim
   one with just errstr[MAX_LEN_STRING] which is a seems a
   waste of space.

q: Memory alloc policy, what is better: (Case: I expect an
   arbitary long string, break it up in bite size chunks and
   compare these with some other bite size chunks. The original
   string can be very long, several kilobytes and the bite size
   chunks should be short, say less than a 100 bytes but might
   occasionally long. 

	1. use a char buff[VERY_LONG] and tmp1[NORMAL], tmp2[NORMAL]
           and flash errors when anything is too long

	2. use a palloc/pstrdup for the buff, but still use 
	   tmp1[NORMAL], tmp2[NORMAL].

	3. use palloc for all three.

	4. use palloc for all three and even bother freeing the tmp1 and
	   tmp2 as they are in a loop.

Any ideas; this is really API policy.


View raw message