On 9 February 2010 04:00, Tim Jenness <[log in to unmask]> wrote:
> Commit summary from repository starlink
> ------------------------------------
>
> (Tim Jenness) Unify Starlink URL
> 1.4% applications/cursa/
> 34.4% applications/echomop/doc/htmlhelp/
> 1.2% applications/obsolete/iuedr/hyper/
> 1.0% applications/obsolete/star2html-old/
> 3.4% applications/obsolete/starman/html/
> 3.0% applications/obsolete/
> 11.1% applications/
> 1.0% docs/obsolete/sgp/046/
> 1.7% docs/obsolete/sun/
> 2.7% docs/sc/
> 2.2% docs/sg/
> 1.0% docs/sgp/031/
> 3.7% docs/sgp/
> 2.2% docs/ssn/
> 1.8% docs/sug/
> 13.7% docs/sun/001/
> 2.2% docs/sun/009/
> 2.9% docs/sun/
> 1.1% libraries/pcs/pcs-docs/
> 6.1% libraries/
>
> (Tim Jenness) smurf: Need to malloc and copy the data rather than just copying the pointer
> 100.0% applications/smurf/libsmf/
The single line
pntr[0] = astStore( NULL, da->flatcal, nelem * sizeof(*(da->flatcal)) );
does the same as
pntr[0] = smf_malloc( nelem, sizeof(*(da->flatcal)), 0, status );
memcpy( pntr[0], da->flatcal, nelem * sizeof(*(da->flatcal)) );
and allows you (via the first argument set to NULL above) to specify
some pre-allocated memory to be realloced, rather than making a new
allocation. The functions astStore and *paricularly* astGrow are
really convenient memory management functions.
David
|