MetaDataBlock Data Pointer Allocation

This topic contains 1 reply, has 2 voices, and was last updated by  Tobias Hector 5 years, 8 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #30882



    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 …

    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.



Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.