Dynamic Array 2: Classification

Source: Internet
Author: User

* Carrayx

-Carrayfixflat

-Carrayfixseg

-Carrayvarseg

* Rarray

* Rpointerarray

 

Carrayx naming

* Fix: the element length is equal and included in the array buffer.

* Var: the length of an element is different. Each element is contained in its own heap unit. The Array Buffer contains the pointer of this element.

* Pak: indicates the packed array. The element length is different. Each element is stored in the Array Buffer and contains length information.

* PTR: the element is a pointer to a cbase-derived object.

* Flat: uses a flat buffer to store data.

* Seg: uses a segmented buffer to save data.

 

* Carrayfixflat

-Fixed element size, included in the array itself

-This array occupies a separate area in the memory.

-Elements are owned by arrays and destroyed by arrays.

* Carrayfixseg

-Fixed element size, included in the array itself

-Multiple areas in memory occupied by Arrays

-Elements are owned by arrays and destroyed by arrays.

* Carrayvarflat

-Variable element size

-Each element is separated from the heap.

-Arrays are composed of pointers to these elements.

-Separate areas in memory occupied by Arrays

-Elements are owned by arrays and destroyed by arrays.

* Carrayvarseg

-Variable element size

-Each element is separated from the heap.

-Arrays are composed of pointers to these elements.

-The array occupies multiple segments in the memory.

-Elements are owned by arrays and destroyed by arrays.

* Carrayptrflat

-The element is the object pointer of the cbase derived class.

-The array occupies a separate area.

-The element must be destroyed independently by calling reasetanddestroy () before the array is deleted.

* Carrayptrseg

-The element is the pointer to the object of the cbase derived class.

-Multiple areas in memory occupied by Arrays

-The element must be destroyed independently by calling reasetanddestroy () before the array is deleted.

* Carraypakflat

-Variable element size, included in the array

-The data of each element is previously indicated with the length of the element, which is very similar to the descriptor.

-Multiple areas in memory occupied by Arrays

-Elements are owned by arrays and destroyed by arrays.

 

* Rarray

-Stack-based or heap-based

-The cleaning should be completed by calling the close () or reset () function.

* Rpointerarray

-The element is a pointer.

-The object to which each element points is located in the heap.

-If these objects are owned by other objects, call close () or reset () to clean up the memory,

-If these objects are owned by the array itself, you must call the resetanddestroy () function to clear the memory.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.