Revision history for KeyPgOpNew
Deletions:
Revision [22500]
Edited on 2018-09-22 10:16:52 by JeffMarshall [uinteger count is allocated only if there is a destructor]Additions:
The total memory, in bytes, to be allocated with ##**New** //datatype//[//count//]## expression is calculated as ##//sizeof(datatype) * count//##, plus ##//sizeof(uinteger)//## if there is an implicit or explicit ##[[KeyPgDestructor|Destructor]]##. The total memory requested in bytes to be allocated must not overflow the value that can be held by a ##[[KeyPgUinteger|Uinteger]]##. The extra ##//uinteger//##, if allocated, stores the number of elements as part of the allocation, so that ##[[KeyPgOpDelete|Delete Statement]]## can determine the count of destructors to call.
If the memory allocation fails, a null pointer is returned and no constructors are called.
Deletions:
No Differences
Deletions:
Revision [22496]
Edited on 2018-09-20 21:21:35 by JeffMarshall [new can return null poniter, allocation must not exceed uinteger]Additions:
A pointer of type [[DataType|datatype]] to the newly allocated data, or null pointer if the memory allocation failed.
The total memory, in bytes, to be allocated with ##**New** //datatype//[//count//]## is calculated as ##//sizeof(datatype) * count + sizeof(uinteger)//##. ##//count//## specifies the number of elements to be allocated, and the total memory requested to be allocated must not overflow the value that can be held by a ##[[KeyPgUinteger|Uinteger]]##. The extra ##//uinteger//## stores the number of elements allocated as part of the allocation.
The total memory, in bytes, to be allocated with ##**New** //datatype//[//count//]## is calculated as ##//sizeof(datatype) * count + sizeof(uinteger)//##. ##//count//## specifies the number of elements to be allocated, and the total memory requested to be allocated must not overflow the value that can be held by a ##[[KeyPgUinteger|Uinteger]]##. The extra ##//uinteger//## stores the number of elements allocated as part of the allocation.
Deletions:
Revision [22449]
Edited on 2018-08-30 03:24:38 by fxm [Page updated while 'Operator New Overload' page creation]Additions:
**Note:** Using ##//pointer// = **New** //datatype//[//count//]## may be unsafe if ##//pointer//## was declared with a type different from ##//datatype//## (for sub-type polymorphism purpose for example), because the pointer arithmetic fails to access the elements if the pointer type size is different from the size of ##//datatype//## (when using ##{{fbdoc item="keyword" value="KeyPgOpPtrIndex|Operator [] (Pointer index)"}}## or adding an offset (element number) to the pointer, or even when ##**Delete[] Statement**## itself (the array-version of ##[[KeyPgOpDelete|Delete Statement]]##) must destroy the elements).
Deletions:
Revision [22446]
Edited on 2018-08-30 02:25:48 by fxm [Page updated while 'Operator New Overload' page creation]Additions:
The dynamic memory allocation process part provided by the ##**New Expression**## operator can be overloaded for user-defined types as a member operator ##[[KeyPgOpNewOverload|New Overload]]##. The following process part for data construction can never be modified.
Deletions:
Revision [22432]
Edited on 2018-08-29 13:13:20 by fxm [Page updated while 'Operator New Overload' page creation]Additions:
The dynamic memory allocation process provided by the ##**New Expression**## operator can be overloaded for user-defined types as a member operator ##[[KeyPgOpNewOverload|New Overload]]##. The following process of data construction can never be modified.
Deletions:
Revision [22420]
Edited on 2018-08-29 08:16:49 by fxm [Page updated while 'Operator New Overload' page creation]Deletions:
Additions:
The dynamic memory allocation process provided by the ##**New Expression**## operator can be overloaded for user-defined types as a member operator ##[[KeyPgOpNewOverload|New Overload]]##.
Deletions:
Additions:
##**New[] Expression**## operator is the array-version of the ##**New Expression**## operator and allocates enough memory for the specified number of objects. The default constructor for the type will be used to set the initial values for each item.
Objects created with ##**New Expression**## operator must be freed with ##[[KeyPgOpDelete|Delete Statement]]## operator. Object array created with ##**New[] Expression**## operator must be freed with ##**Delete[] Statement**## operator, the array-version of ##[[KeyPgOpDelete|Delete Statement]]## operator. You cannot mix and match the different versions of the operators.
The dynamic memory allocation process provided by the ##**New Expression**## operator can be overloaded for user-defined types as a member ##[[KeyPgOpNewOverload|New Overload]]## operator.
- ##[[KeyPgOpDelete|Delete Statement]]##
- ##[[KeyPgOpNewOverload|New Overload]]##
Objects created with ##**New Expression**## operator must be freed with ##[[KeyPgOpDelete|Delete Statement]]## operator. Object array created with ##**New[] Expression**## operator must be freed with ##**Delete[] Statement**## operator, the array-version of ##[[KeyPgOpDelete|Delete Statement]]## operator. You cannot mix and match the different versions of the operators.
The dynamic memory allocation process provided by the ##**New Expression**## operator can be overloaded for user-defined types as a member ##[[KeyPgOpNewOverload|New Overload]]## operator.
- ##[[KeyPgOpDelete|Delete Statement]]##
- ##[[KeyPgOpNewOverload|New Overload]]##
Deletions:
Objects created with ##**New**## must be freed with ##[[KeyPgOpDelete|Delete]]##. Memory allocated with ##**New[]**## must be freed with ##**Delete[]**##, the array-version of ##[[KeyPgOpDelete|Delete]]##. You cannot mix and match the different versions of the operators.
This operator can be overloaded for user-defined types as a member ##[[KeyPgOperator|Operator]]##.
- ##[[KeyPgOpDelete|Delete]]##
Additions:
==={{color text="Update in progress (@fxm)." c="red"}}===
Deletions:
Additions:
The ##**New Expression**## operator dynamically allocates memory and constructs a specified data type.
Deletions:
[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **new** ( //size// [[KeyPgAs|as]] [[KeyPgUinteger|uinteger]] ) [[KeyPgAs|as]] [[KeyPgAny|any]] [[KeyPgPtr|ptr]]
[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **new[]** ( //size// [[KeyPgAs|as]] [[KeyPgUinteger|uinteger]] ) [[KeyPgAs|as]] [[KeyPgAny|any]] [[KeyPgPtr|ptr]]
##//size//##
Number of bytes to allocate.
The ##**New**## operator dynamically allocates memory and constructs a specified data type.
Additions:
==={{color text="Update in progress (@fxm)" c="red"}}===
Deletions:
Additions:
{{fbdoc item="title" value="Operator New Expression"}}----
Deletions:
Additions:
==={{color text="Update in progress (@fxm)." c="red"}}===
Revision [22370]
Edited on 2018-08-25 07:59:43 by fxm [Added note highlighting the risk to use NEW[] ... DELETE[] in some cases]Additions:
**Note:** Using ##//pointer// = **New** //datatype//[//count//]## may be unsafe if ##//pointer//## was declared with a type different from ##//datatype//## (for sub-type polymorphism purpose for example), because the pointer arithmetic fails to access the elements if the pointer type size is different from the size of ##//datatype//## (when using ##{{fbdoc item="keyword" value="KeyPgOpPtrIndex|Operator [] (Pointer index)"}}## or adding an offset (element number) to the pointer, or even when ##**Delete[]**## itself (the array-version of ##[[KeyPgOpDelete|Delete]]##) must destroy the elements).
Deletions:
Revision [22366]
Edited on 2018-08-25 04:25:16 by fxm [Added note highlighting the risk to use NEW[] ... DELETE[] in some cases]Additions:
**Note:** Using ##//pointer// = **New** //datatype//[//count//]## may be unsafe if ##//pointer//## was declared with a type different from ##//datatype//## because the pointer arithmetic fails to access the elements if the pointer type size is different from the size of ##//datatype//## (when using ##{{fbdoc item="keyword" value="KeyPgOpPtrIndex|Operator [] (Pointer index)"}}## or adding an offset (element number) to the pointer, or even when ##**Delete[]**## itself (the array-version of ##[[KeyPgOpDelete|Delete]]##) must destroy the elements).
Additions:
For simple types, like integers, an initial value can be given. For types without constructors, initial values can be specified for each field (either with default initializer at data-field declaration, or with initializer list as in ##**New** //datatype// (**initializers, ..**)## if all type data-fields are numeric primitives only and without any default initializers). For types with at least one constructor, the initialize list (if any) must match an existing constructor. If no initializers are given, the default values for those types will be set.
Deletions:
Additions:
The ##**New**## operator dynamically allocates memory and constructs a specified data type.
For simple types, like integers, an initial value can be given. For types without constructors, initial values can be specified for each field (either with default initializer at data-field declaration, or with initializer list as in ##**New** //datatype// (**initializers, ..**)## if all type data-fields are numeric primitives only and without any default initializers). Types that have constructors can have their constructors called by ##**New**## as well. If no initializers are given, the default values for those types will be set.
For simple types, like integers, an initial value can be given. For types without constructors, initial values can be specified for each field (either with default initializer at data-field declaration, or with initializer list as in ##**New** //datatype// (**initializers, ..**)## if all type data-fields are numeric primitives only and without any default initializers). Types that have constructors can have their constructors called by ##**New**## as well. If no initializers are given, the default values for those types will be set.
Deletions:
Additions:
The ##**New**## operator dynamically allocates memory and constructs a specified data type. For simple types, like integers, an initial value can be given. For types without constructors, initial values can be specified for each field (either with default initializer at data-field declaration, or with initializer list as in ##**New** //datatype// (**initializers, ..**)## if all type data-fields are numeric primitives only and without any default initializers). Types that have constructors can have their constructors called by ##**New**## as well. If no initializers are given, the default values for those types will be set.
Specifying an initial value of ##[[KeyPgAny|Any]]##, as in ##**New** //datatype// (**Any**)## will allocate memory for the type, but not initialize the data. This is only valid on data types that do not have constructors (otherwise for data types with constructors, syntax of simple memory allocation with pointer conversion, like //Cptr(datatype Ptr, Allocate(Sizeof(datatype)))//, can be substituted to the invalid use of New...Any).
Specifying an initial value of ##[[KeyPgAny|Any]]##, as in ##**New** //datatype//[//count//] {**Any**}## will allocate memory for the array, but not initialize the data. This is only valid on data types that do not have constructors (otherwise for data types with constructors, syntax of simple memory allocation with pointer conversion, like //Cptr(datatype Ptr, Allocate(count * Sizeof(datatype)))//, can be substituted to the invalid use of New...Any).
Specifying an initial value of ##[[KeyPgAny|Any]]##, as in ##**New** //datatype// (**Any**)## will allocate memory for the type, but not initialize the data. This is only valid on data types that do not have constructors (otherwise for data types with constructors, syntax of simple memory allocation with pointer conversion, like //Cptr(datatype Ptr, Allocate(Sizeof(datatype)))//, can be substituted to the invalid use of New...Any).
Specifying an initial value of ##[[KeyPgAny|Any]]##, as in ##**New** //datatype//[//count//] {**Any**}## will allocate memory for the array, but not initialize the data. This is only valid on data types that do not have constructors (otherwise for data types with constructors, syntax of simple memory allocation with pointer conversion, like //Cptr(datatype Ptr, Allocate(count * Sizeof(datatype)))//, can be substituted to the invalid use of New...Any).
Deletions:
Specifying an initial value of ##[[KeyPgAny|Any]]##, as in ##**New** //datatype//(**Any**)## will allocate memory for the type, but not initialize the data. This is only valid on data types that do not have constructors (otherwise for data types with constructors, syntax of simple memory allocation with pointer conversion, like //Cptr(datatype Ptr, Allocate(Sizeof(datatype)))//, can be substituted to the invalid use of New...Any).
Specifying an initial value of ##[[KeyPgAny|Any]]##, as in ##**New** //datatype//[//count//]{**Any**}## will allocate memory for the array, but not initialize the data. This is only valid on data types that do not have constructors (otherwise for data types with constructors, syntax of simple memory allocation with pointer conversion, like //Cptr(datatype Ptr, Allocate(count * Sizeof(datatype)))//, can be substituted to the invalid use of New...Any).
Revision [21346]
Edited on 2016-04-15 03:30:32 by fxm [Added reference to KeyPgOperator when overloaded as member operator]Additions:
This operator can be overloaded for user-defined types as a member ##[[KeyPgOperator|Operator]]##.
Additions:
Additions:
[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **new** ( //size// [[KeyPgAs|as]] [[KeyPgUinteger|uinteger]] ) [[KeyPgAs|as]] [[KeyPgAny|any]] [[KeyPgPtr|ptr]]
[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **new[]** ( //size// [[KeyPgAs|as]] [[KeyPgUinteger|uinteger]] ) [[KeyPgAs|as]] [[KeyPgAny|any]] [[KeyPgPtr|ptr]]
//result// = **New** //[[DataType|datatype]]//
//result// = **New** //[[DataType|datatype]]// ( //initializers//, ... )
//result// = **New** //[[DataType|datatype]]//**[** //count// **]**
A pointer of type [[DataType|datatype]] to the newly allocated data.
Objects created with ##**New**## must be freed with ##[[KeyPgOpDelete|Delete]]##. Memory allocated with ##**New[]**## must be freed with ##**Delete[]**##, the array-version of ##[[KeyPgOpDelete|Delete]]##. You cannot mix and match the different versions of the operators.
Specifying an initial value of ##[[KeyPgAny|Any]]##, as in ##**New** //datatype//(**Any**)## will allocate memory for the type, but not initialize the data. This is only valid on data types that do not have constructors (otherwise for data types with constructors, syntax of simple memory allocation with pointer conversion, like //Cptr(datatype Ptr, Allocate(Sizeof(datatype)))//, can be substituted to the invalid use of New...Any).
Specifying an initial value of ##[[KeyPgAny|Any]]##, as in ##**New** //datatype//[//count//]{**Any**}## will allocate memory for the array, but not initialize the data. This is only valid on data types that do not have constructors (otherwise for data types with constructors, syntax of simple memory allocation with pointer conversion, like //Cptr(datatype Ptr, Allocate(count * Sizeof(datatype)))//, can be substituted to the invalid use of New...Any).
- Only available in the //[[CompilerOptlang|-lang fb]]// dialect.
- ##[[KeyPgOpDelete|Delete]]##
- ##[[KeyPgOpPlacementNew|Placement New]]##
[[KeyPgDeclare|declare]] [[KeyPgOperator|operator]] **new[]** ( //size// [[KeyPgAs|as]] [[KeyPgUinteger|uinteger]] ) [[KeyPgAs|as]] [[KeyPgAny|any]] [[KeyPgPtr|ptr]]
//result// = **New** //[[DataType|datatype]]//
//result// = **New** //[[DataType|datatype]]// ( //initializers//, ... )
//result// = **New** //[[DataType|datatype]]//**[** //count// **]**
A pointer of type [[DataType|datatype]] to the newly allocated data.
Objects created with ##**New**## must be freed with ##[[KeyPgOpDelete|Delete]]##. Memory allocated with ##**New[]**## must be freed with ##**Delete[]**##, the array-version of ##[[KeyPgOpDelete|Delete]]##. You cannot mix and match the different versions of the operators.
Specifying an initial value of ##[[KeyPgAny|Any]]##, as in ##**New** //datatype//(**Any**)## will allocate memory for the type, but not initialize the data. This is only valid on data types that do not have constructors (otherwise for data types with constructors, syntax of simple memory allocation with pointer conversion, like //Cptr(datatype Ptr, Allocate(Sizeof(datatype)))//, can be substituted to the invalid use of New...Any).
Specifying an initial value of ##[[KeyPgAny|Any]]##, as in ##**New** //datatype//[//count//]{**Any**}## will allocate memory for the array, but not initialize the data. This is only valid on data types that do not have constructors (otherwise for data types with constructors, syntax of simple memory allocation with pointer conversion, like //Cptr(datatype Ptr, Allocate(count * Sizeof(datatype)))//, can be substituted to the invalid use of New...Any).
- Only available in the //[[CompilerOptlang|-lang fb]]// dialect.
- ##[[KeyPgOpDelete|Delete]]##
- ##[[KeyPgOpPlacementNew|Placement New]]##
Deletions:
[[KeyPgDeclare declare]] [[KeyPgOperator operator]] **new[]** ( //size// [[KeyPgAs as]] [[KeyPgUinteger uinteger]] ) [[KeyPgAs as]] [[KeyPgAny any]] [[KeyPgPtr ptr]]
//result// = **New** //[[DataType datatype]]//
//result// = **New** //[[DataType datatype]]// ( //initializers//, ... )
//result// = **New** //[[DataType datatype]]//**[** //count// **]**
A pointer of type [[DataType datatype]] to the newly allocated data.
Objects created with ##**New**## must be freed with ##[[KeyPgOpDelete Delete]]##. Memory allocated with ##**New[]**## must be freed with ##**Delete[]**##, the array-version of ##[[KeyPgOpDelete Delete]]##. You cannot mix and match the different versions of the operators.
Specifying an initial value of ##[[KeyPgAny Any]]##, as in ##**New** //datatype//(**Any**)## will allocate memory for the type, but not initialize the data. This is only valid on data types that do not have constructors (otherwise for data types with constructors, syntax of simple memory allocation with pointer conversion, like //Cptr(datatype Ptr, Allocate(Sizeof(datatype)))//, can be substituted to the invalid use of New...Any).
Specifying an initial value of ##[[KeyPgAny Any]]##, as in ##**New** //datatype//[//count//]{**Any**}## will allocate memory for the array, but not initialize the data. This is only valid on data types that do not have constructors (otherwise for data types with constructors, syntax of simple memory allocation with pointer conversion, like //Cptr(datatype Ptr, Allocate(count * Sizeof(datatype)))//, can be substituted to the invalid use of New...Any).
- Only available in the //[[CompilerOptlang -lang fb]]// dialect.
- ##[[KeyPgOpDelete Delete]]##
- ##[[KeyPgOpPlacementNew Placement New]]##
Additions:
[[KeyPgDeclare declare]] [[KeyPgOperator operator]] **new** ( //size// [[KeyPgAs as]] [[KeyPgUinteger uinteger]] ) [[KeyPgAs as]] [[KeyPgAny any]] [[KeyPgPtr ptr]]
[[KeyPgDeclare declare]] [[KeyPgOperator operator]] **new[]** ( //size// [[KeyPgAs as]] [[KeyPgUinteger uinteger]] ) [[KeyPgAs as]] [[KeyPgAny any]] [[KeyPgPtr ptr]]
[[KeyPgDeclare declare]] [[KeyPgOperator operator]] **new[]** ( //size// [[KeyPgAs as]] [[KeyPgUinteger uinteger]] ) [[KeyPgAs as]] [[KeyPgAny any]] [[KeyPgPtr ptr]]
Deletions:
[[KeyPgDeclare declare]] [[KeyPgOperator operator]] **new[]** ( //size// [[KeyPgAs as]] [[KeyPgUinteger uinteger]] ) [[KeyPgAs as]] [[DataType datatype]] [[KeyPgPtr ptr]]
Revision [17096]
Edited on 2014-06-21 13:31:40 by FxMwikki [The 'New' operator returns a typed pointer]Additions:
[[KeyPgDeclare declare]] [[KeyPgOperator operator]] **new** ( //size// [[KeyPgAs as]] [[KeyPgUinteger uinteger]] ) [[KeyPgAs as]] [[DataType datatype]] [[KeyPgPtr ptr]]
[[KeyPgDeclare declare]] [[KeyPgOperator operator]] **new[]** ( //size// [[KeyPgAs as]] [[KeyPgUinteger uinteger]] ) [[KeyPgAs as]] [[DataType datatype]] [[KeyPgPtr ptr]]
[[KeyPgDeclare declare]] [[KeyPgOperator operator]] **new[]** ( //size// [[KeyPgAs as]] [[KeyPgUinteger uinteger]] ) [[KeyPgAs as]] [[DataType datatype]] [[KeyPgPtr ptr]]
Deletions:
[[KeyPgDeclare declare]] [[KeyPgOperator operator]] **new[]** ( //size// [[KeyPgAs as]] [[KeyPgUinteger uinteger]] ) [[KeyPgAs as]] [[KeyPgAny any]] [[KeyPgPtr ptr]]
Revision [17057]
Edited on 2014-04-27 07:41:06 by FxMwikki [NEW/DELETE and NEW[]/DELETE[] can now be used with the dynamic STRING data type]Deletions:
Revision [16989]
Edited on 2014-01-10 03:56:17 by FxMwikki [Added substitutive syntax for "New...Any" invalid when types with constructors]Additions:
Specifying an initial value of ##[[KeyPgAny Any]]##, as in ##**New** //datatype//(**Any**)## will allocate memory for the type, but not initialize the data. This is only valid on data types that do not have constructors (otherwise for data types with constructors, syntax of simple memory allocation with pointer conversion, like //Cptr(datatype Ptr, Allocate(Sizeof(datatype)))//, can be substituted to the invalid use of New...Any).
Specifying an initial value of ##[[KeyPgAny Any]]##, as in ##**New** //datatype//[//count//]{**Any**}## will allocate memory for the array, but not initialize the data. This is only valid on data types that do not have constructors (otherwise for data types with constructors, syntax of simple memory allocation with pointer conversion, like //Cptr(datatype Ptr, Allocate(count * Sizeof(datatype)))//, can be substituted to the invalid use of New...Any).
Specifying an initial value of ##[[KeyPgAny Any]]##, as in ##**New** //datatype//[//count//]{**Any**}## will allocate memory for the array, but not initialize the data. This is only valid on data types that do not have constructors (otherwise for data types with constructors, syntax of simple memory allocation with pointer conversion, like //Cptr(datatype Ptr, Allocate(count * Sizeof(datatype)))//, can be substituted to the invalid use of New...Any).
Deletions:
Specifying an initial value of ##[[KeyPgAny Any]]##, as in ##new //datatype//[//count//]{any}## will allocate memory for the array, but not initialize the data. This is only valid on data types that do not have constructors.
Additions:
The ##**New**## and ##**New[]**## operators cannot be directly used with ##[[KeyPgString String]]##, but work with ##[[KeyPgType UDT]]##s containing strings.
Deletions:
Additions:
Specifying an initial value of ##[[KeyPgAny Any]]##, as in ##new //datatype//(any)## will allocate memory for the type, but not initialize the data. This is only valid on data types that do not have constructors.
Specifying an initial value of ##[[KeyPgAny Any]]##, as in ##new //datatype//[//count//]{any}## will allocate memory for the array, but not initialize the data. This is only valid on data types that do not have constructors.
Specifying an initial value of ##[[KeyPgAny Any]]##, as in ##new //datatype//[//count//]{any}## will allocate memory for the array, but not initialize the data. This is only valid on data types that do not have constructors.
Deletions:
Specifying an initial value of ##[[KeyPgAny Any]]##, as in ##new datatype[count]{any}## will allocate memory for the array, but not initialize the data. This is only valid on data types that do not have constructors.
Additions:
Operator to dynamically allocate memory and construct data of a specified type.
' Create and initialize a "rational" and store its address.
' Allocate memory for 100 integers and store the address of the first one.
' Create and initialize a "rational" and store its address.
' Allocate memory for 100 integers and store the address of the first one.
Deletions:
' Create and initialize a Rational, and store it's address.
' Allocate memory for 100 integers, store the address of the first one.
Additions:
The ##**New**## or ##**New[]**## operator cannot be directly used with ##[[KeyPgString String]]##, but works with ##[[KeyPgType UDT]]## containing string.
Deletions:
Additions:
The ##**New**## or ##**New[]**## operator cannot be used with ##[[KeyPgString String]]##, but can be used with ##[[KeyPgType UDT]]## containing string.
Deletions:
Additions:
The ##**New**## or ##**New[]**## operator cannot be used with ##[[KeyPgString String]]##, but can be used with ##[[KeyPgType UDT]]## containing ##[[KeyPgString String]]##.
Deletions:
Additions:
The ##**New**## or ##**New[]**## operator cannot be used with ##[[KeyPgString String]]##, but can be used with UDT containing ##[[KeyPgString String]]##.
Deletions:
Additions:
The ##**New**## or ##**New[]**## operator cannot be used with ##[[KeyPgString String]]##.
Revision [14394]
Edited on 2009-08-29 21:55:35 by CountingPine [Remove CamelCase links in "New to FreeBASIC"]Additions:
- New to ""FreeBASIC""
Deletions:
Revision [13702]
Edited on 2008-09-07 09:18:19 by EcLipzer [Remove CamelCase links in "New to FreeBASIC"]Additions:
Number of bytes to allocate.
Name of the data type to create.
Exact number of elements to allocate.
Name of the data type to create.
Exact number of elements to allocate.
Deletions:
name of the data type to create.
Number of elements to allocate.