[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [lvm-devel] [PATCH 6/6] RFC: Change lvm2app version number from 1 to 2.



On 04/01/2010 11:57 PM, Dave Wysochanski wrote:
> This version number change reflects the memory handling change
> for string-based pv/vg/lv string based attributes.

Maybe it is better idea to use VG mempool, maybe not for
VG attributes.

But change it now, it means that application using
calls which previously deallocates these attributes with dm_free
will now crash, because the memory returned is now owned
by library.

I really do not like changing API this way in every release...

I see three API possibilities

 - define buffer parameter, so all memory allocations are
in user application

 - return strings/parameters *CONST* and define that lvm2app
owns memory

 - use dm_malloc, and require dm_free in user aplications.

But please do not change this later!

It is extremely confusing for library users,
no warning that API is not stable will not help here...

Milan


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]