dtc: Abolish asize field of struct data
The asize field in struct data is a hangover from the early days when a struct data was sometimes allowed to refer to a static chunk of memory rather than a malloc()ed block.
That's long gone, since the lifetime issues were far more trouble than it was worth, so get rid of the asize field.
Signed-off-by David Gibson <[email protected]>
dtc.h +0 -1
@@ -118,7 +118,6 @@struct data {int len;char *val; -int asize;struct marker *markers; };
data.c +0 -8
@@ -32,8 +32,6 @@ m = nm; } -assert (!d.val || d.asize); -if (d.val)free (d.val); }
@@ -43,9 +41,6 @@struct data nd;int newsize; -/* we must start with an allocated datum */ -assert (!d.val || d.asize); -if (xlen ==0 )return d;
@@ -56,11 +51,8 @@while ((d.len + xlen) > newsize) newsize *=2 ; - nd.asize = newsize; nd.val =xrealloc (d.val, newsize); -assert (nd.asize >= (d.len + xlen)); -return nd; }
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson