[Scilab-users] %mlistType_clear overloading of clear() for mlist custom types

Clément David Clement.David at esi-group.com
Wed Jul 1 20:47:18 CEST 2020


Hello all,

Indeed this introduction was made to fulfill the needs for external objects to be clear as any other Scilab variables. I made some early prototypes for hdf5 and xml but failed to push them further. IMHO this is feasible but there are some specific needs for each overloading (clearing the H5objects table with -1 to make the slot available for HDF5; dereferencing the element on the general doc instance for XML).

Thanks,

Clément DAVID

> -----Original Message-----
> From: users <users-bounces at lists.scilab.org> On Behalf Of Stéphane Mottelet
> Sent: Wednesday, July 1, 2020 6:59 PM
> To: users at lists.scilab.org
> Subject: Re: [Scilab-users] %mlistType_clear overloading of clear() for mlist
> custom types
> 
> 
> 
> 
> Le 01/07/2020 à 18:52, Samuel Gougeon a écrit :
> 
> 
> 	Le 01/07/2020 à 13:47, Stéphane Mottelet a écrit :
> 
> 
> 		Right, sorry for my previous message.
> 
> 
> 		But, at the user level there are very few use cases: the clear
> overload is only useful if some mlist fields contain some pointers to allocated
> data. For example sparse LU  factors or Java objects.
> 
> 
> 
> 
> 	The auto-clearing of the Java side of Java objects is already
> implemented (and it's documented).
> 
> 
> I am not sure it worked perfectly before. Clement's patch is essentially dealing
> with this case, see e.g.:
> 
> https://codereview.scilab.org/#/c/20679/14/scilab/modules/external_objects/s
> ci_gateway/cpp/sci_percent_EObj_clear.cpp
> 
> https://codereview.scilab.org/#/c/20679/14/scilab/modules/external_objects/s
> rc/cpp/clear.cpp
> 
> 
> S.
> 
> 
> 
> 
> 
> 
> 	I am wondering if a similar native auto-clearing could be implemented
> for xml and hdf5 objects.
> 	I guess that using clear before h5close() or xmlDelete() could make
> memory leaking.
> 
> 	Samuel
> 
> 
> 
> 
> 	_______________________________________________
> 	users mailing list
> 	users at lists.scilab.org <mailto:users at lists.scilab.org>
> 	https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLm
> Zy/lists.scilab.org/mailman/listinfo/users
> 
> --
> Stéphane Mottelet
> Ingénieur de recherche
> EA 4297 Transformations Intégrées de la Matière Renouvelable Département
> Génie des Procédés Industriels Sorbonne Universités - Université de Technologie
> de Compiègne CS 60319, 60203 Compiègne cedex Tel : +33(0)344234688
> http://www.utc.fr/~mottelet


More information about the users mailing list