[postgis-tickets] [PostGIS] #2494: Avoid unnecessary memory copy in gserialized_datum_get_box2df_p

PostGIS trac at osgeo.org
Wed Oct 2 20:47:19 PDT 2013


#2494: Avoid unnecessary memory copy in gserialized_datum_get_box2df_p
---------------------+------------------------------------------------------
 Reporter:  hayamiz  |       Owner:  pramsey
     Type:  patch    |      Status:  new    
 Priority:  medium   |   Milestone:         
Component:  postgis  |     Version:  2.0.x  
 Keywords:           |  
---------------------+------------------------------------------------------
 In gserialized_datum_get_box2df_p, PG_DETOAST_DATUM_SLICE is always called
 for obtaining header section of the gserialized datum.
 PG_DETOAST_DATUM_SLICE always performs memory allocation and copy, but
 such memory operations are not necessary when the datum is not extended(
 not external nor compressed ).

 This patch removes such extra memory operations.
 In case of non-external and non-compressed geometry data, PG_DETOAST_DATUM
 is used instead of _SLICE. For external or compressed (typically large)
 geometry data, PG_DETOAST_DATUM_SLICE is still used not to copy whole
 objects.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2494>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list