RFC 17: Dynamic Array Sizing

Frank Warmerdam warmerdam at POBOX.COM
Mon May 15 17:57:55 EDT 2006


Sean Gillies wrote:
 >Daniel says:
>> I would tend to agree with Ned that changing the meaning of a variable
>> in a data structure without changing its name is asking for trouble.
>>
>> PHP MapScript never accesses layers, classes and styles by index
>> directly, you must go through a get() method all the time. Doesn't SWIG
>> MapScript have the same get() methods? Could we not hide the arrays and
>> enforce the use of get() methods?
> 
> Daniel,
> 
> You're right, it's getLayer(index), getClass(index), etc. You can't 
> directly access layers in the SWIG-generated modules unless this is a 
> new feature. I got off the SWIG bandwagon around 1.3.26, so I don't know 
> for sure.

Guys,

OK, this is looking quite promising.  I was under the (mistaken) impression
that mapscript application were able to directly access these objects.  With
this new information I *think* we can handle things by having a small initial
allocation and growing it as needed.  And also changing the various arrays
to arrays of pointers so that we don't have things moving around in memory
on us a new objects are created.

I'll prepare a revised RFC 17 after doing a bit of local testing with
PHP and Python MapScript to verify some of my assumptions.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGF, http://osgeo.org



More information about the mapserver-dev mailing list