Imagination PowerVR SDK Blog

MetaDataBlock Data Pointer Allocation


#1

Hi!


Congratulation on the release, I am vey happy to integrate this thread-safe version that opens a few tricks to me.
I am using the new PVR3 MetaDataBlock structure to add my own custom meta data on my textures.
At first I tried passing references of data on the stack but quickly realized that it must be passed a pointer to the heap.
I just wanted to have a clear statement that I am not responsible for deleting that data.
I find it a strange behavior to delete someone else’s pointers but why not? If that makes sense at some point for you …

Best,

M

#2

Hi Micha,

The MetaDataBlock Struct currently has to delete the data it uses because from experience it’s very hard to manage the data otherwise. Unfortunately a destructor deleting the data was a fairly close the the wire addition to fix a lot of outstanding issues, rather than something I had necessarily planned. At some point I would like to add proper construction and data setting to the meta data block to handle this correctly, but in the meantime yes, the struct will attempt to call “delete []” on any data you pass to it.

Thanks,

Tobias