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:
- is there means to check the Memory block/buffer allocated for the object of a large custom data type?
- 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:
- at beginning, a specified amount of memory will be allocated for the storage of later instantiated objects of this custom data type,
- at runtime, a new object of this type must be saved/written in this memory block.
- 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.
- at end, the Memory block should be deleted.