Qt World Summit: Submit your Presentation

check memory block/buffer using QBuffer?

  • My application has custom data type of large size, say ca. 10MB. In order to avoid too much memory burden, I'd like to write a function/Interface to check the memory block/buffer allocated for the objects of this custom data type. Thru Google I come across QBuffer and QDataStream for a possible solution. However I have no idea, how to specify the maxsize of the Memory block/buffer with help of QBuffer togather with QDataStream. Please give me kindly suggestions on:

    1. is there means to check the Memory block/buffer allocated for the object of a large custom data type?
    2. how to specify the size of QBuffer or QDataStream at a favorite Level?

    Thanks alot in advance!

  • What do you mean by check??

  • my check means:

    1. at beginning, a specified amount of memory will be allocated for the storage of later instantiated objects of this custom data type,
    2. at runtime, a new object of this type must be saved/written in this memory block.
    3. at runtime, the total memory of the created objects of this type must be small than the specified Limit. At that rate, the available memory must be checked before a new object is saved in the memory region.
    4. at end, the Memory block should be deleted.

Log in to reply