php-templates in 6.1

Mark Kent mark at noc.mainstreet.net
Wed Aug 16 17:26:10 UTC 2006


Thanks for the pointers.

What I've discovered about the compile error for php-templates
is that the "bad" code is there as an aid to debugging memory issues.

That is, the zend code appears to depend on pre-processor behavior to
correctly embed the filename and line of the source code in the code
itself, to be stored here:

 typedef struct _zend_mem_header {
 #if ZEND_DEBUG
	 long magic;
	 char *filename;
	 uint lineno;
	 int reported;
	 char *orig_filename;
	 uint orig_lineno;
 # ifdef ZTS
	 THREAD_T thread_id;
 # endif
 #endif
     struct _zend_mem_header *pNext;
     struct _zend_mem_header *pLast;
	 unsigned int size:31;
	 unsigned int cached:1;
 } zend_mem_header;

I haven't clearly thought this out, but something about this bugs
me...  I don't know if it's the irony of being tripped up by a
debugging aid, or the lack of separation of the code itself from the
tools used to debug the code, but I'm definitely irritated by this.

-mark

P.S.  FYI, I'm using "gcc version 3.4.4 [FreeBSD] 20050518"


More information about the freebsd-ports mailing list