Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Aug 2006 10:26:08 -0700 (PDT)
From:      Mark Kent <mark@noc.mainstreet.net>
To:        freebsd-ports@freebsd.org
Cc:        vanilla@fatpipi.cirx.org, mikej@rogers.com
Subject:   Re: php-templates in 6.1
Message-ID:  <20060816172608.01B33284AD@noc.mainstreet.net>
In-Reply-To: <44E348C0.6060105@rogers.com> (message from Mike Jakubik on Wed,  16 Aug 2006 12:33:04 -0400)
References:  <20060815233733.BACC1284F9@noc.mainstreet.net> <20060816035858.GA44287@fatpipi.cirx.org> <44E348C0.6060105@rogers.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060816172608.01B33284AD>