File: repl.txt

package info (click to toggle)
node-stdlib 0.0.96%2Bds1%2B~cs0.0.429-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 421,476 kB
  • sloc: javascript: 1,562,831; ansic: 109,702; lisp: 49,823; cpp: 27,224; python: 7,871; sh: 6,807; makefile: 6,089; fortran: 3,102; awk: 387
file content (345 lines) | stat: -rw-r--r-- 9,042 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345

{{alias}}( [dtype] )
    Returns an uninitialized typed array from a typed array memory pool.

    Memory is **uninitialized**, which means that the contents of a returned
    typed array may contain sensitive contents.

    The function supports the following data types:

    - float64: double-precision floating-point numbers (IEEE 754)
    - float32: single-precision floating-point numbers (IEEE 754)
    - int32: 32-bit two's complement signed integers
    - uint32: 32-bit unsigned integers
    - int16: 16-bit two's complement signed integers
    - uint16: 16-bit unsigned integers
    - int8: 8-bit two's complement signed integers
    - uint8: 8-bit unsigned integers
    - uint8c: 8-bit unsigned integers clamped to 0-255

    The default typed array data type is `float64`.

    Parameters
    ----------
    dtype: string (optional)
        Data type. Default: 'float64'.

    Returns
    -------
    out: TypedArray|null
        If the function is unable to allocate a typed array from the typed array
        pool (e.g., due to insufficient memory), the function returns `null`.

    Examples
    --------
    > var arr = {{alias}}()
    <Float64Array>[]
    > arr = {{alias}}( 'float32' )
    <Float32Array>[]


{{alias}}( length[, dtype] )
    Returns an uninitialized typed array having a specified length from a typed
    array memory pool.

    Parameters
    ----------
    length: integer
        Typed array length.

    dtype: string (optional)
        Data type. Default: 'float64'.

    Returns
    -------
    out: TypedArray|null
        If the function is unable to allocate a typed array from the typed array
        pool (e.g., due to insufficient memory), the function returns `null`.

    Examples
    --------
    > var arr = {{alias}}( 5 )
    <Float64Array>
    > arr = {{alias}}( 5, 'int32' )
    <Int32Array>


{{alias}}( typedarray[, dtype] )
    Creates a pooled typed array from another typed array.

    Parameters
    ----------
    typedarray: TypedArray
        Typed array from which to generate another typed array.

    dtype: string (optional)
        Data type. Default: 'float64'.

    Returns
    -------
    out: TypedArray|null
        If the function is unable to allocate a typed array from the typed array
        pool (e.g., due to insufficient memory), the function returns `null`.

    Examples
    --------
    > var arr1 = {{alias}}( [ 0.5, 0.5, 0.5 ] );
    > var arr2 = {{alias}}( arr1, 'float32' )
    <Float32Array>[ 0.5, 0.5, 0.5 ]


{{alias}}( obj[, dtype] )
    Creates a pooled typed array from an array-like object.

    Parameters
    ----------
    obj: Object
        Array-like object from which to generate a typed array.

    dtype: string (optional)
        Data type. Default: 'float64'.

    Returns
    -------
    out: TypedArray|null
        If the function is unable to allocate a typed array from the typed array
        pool (e.g., due to insufficient memory), the function returns `null`.

    Examples
    --------
    > var arr1 = [ 0.5, 0.5, 0.5 ];
    > var arr2 = {{alias}}( arr1, 'float32' )
    <Float32Array>[ 0.5, 0.5, 0.5 ]


{{alias}}.malloc( [dtype] )
    Returns an uninitialized typed array from a typed array memory pool.

    This method shares the same security vulnerabilities mentioned above.

    Parameters
    ----------
    dtype: string (optional)
        Data type. Default: 'float64'.

    Returns
    -------
    out: TypedArray|null
        If the function is unable to allocate a typed array from the typed array
        pool (e.g., due to insufficient memory), the function returns `null`.

    Examples
    --------
    > var arr = {{alias}}.malloc()
    <Float64Array>
    > arr = {{alias}}.malloc( 'float32' )
    <Float32Array>


{{alias}}.malloc( length[, dtype] )
    Returns a typed array having a specified length from a typed array memory
    pool.

    Parameters
    ----------
    length: integer
        Typed array length.

    dtype: string (optional)
        Data type. Default: 'float64'.

    Returns
    -------
    out: TypedArray|null
        If the function is unable to allocate a typed array from the typed array
        pool (e.g., due to insufficient memory), the function returns `null`.

    Examples
    --------
    > var arr = {{alias}}.malloc( 5 )
    <Float64Array>
    > arr = {{alias}}.malloc( 5, 'int32' )
    <Int32Array>


{{alias}}.malloc( typedarray[, dtype] )
    Creates a pooled typed array from another typed array.

    Parameters
    ----------
    typedarray: TypedArray
        Typed array from which to generate another typed array.

    dtype: string (optional)
        Data type. Default: 'float64'.

    Returns
    -------
    out: TypedArray|null
        If the function is unable to allocate a typed array from the typed array
        pool (e.g., due to insufficient memory), the function returns `null`.

    Examples
    --------
    > var arr1 = {{alias}}.malloc( [ 0.5, 0.5, 0.5 ] );
    > var arr2 = {{alias}}.malloc( arr1, 'float32' )
    <Float32Array>[ 0.5, 0.5, 0.5 ]


{{alias}}.malloc( obj[, dtype] )
    Creates a pooled typed array from an array-like object.

    Parameters
    ----------
    obj: Object
        Array-like object from which to generate a typed array.

    dtype: string (optional)
        Data type. Default: 'float64'.

    Returns
    -------
    out: TypedArray|null
        If the function is unable to allocate a typed array from the typed array
        pool (e.g., due to insufficient memory), the function returns `null`.

    Examples
    --------
    > var arr1 = [ 0.5, 0.5, 0.5 ];
    > var arr2 = {{alias}}.malloc( arr1, 'float32' )
    <Float32Array>[ 0.5, 0.5, 0.5 ]


{{alias}}.calloc( [dtype] )
    Returns a zero-initialized typed array from a typed array memory pool.

    Parameters
    ----------
    dtype: string (optional)
        Data type. Default: 'float64'.

    Returns
    -------
    out: TypedArray|null
        If the function is unable to allocate a typed array from the typed array
        pool (e.g., due to insufficient memory), the function returns `null`.

    Examples
    --------
    > var arr = {{alias}}.calloc()
    <Float64Array>[]
    > arr = {{alias}}.calloc( 'float32' )
    <Float32Array>[]


{{alias}}.calloc( length[, dtype] )
    Returns a zero-initialized typed array having a specified length from a
    typed array memory pool.

    Parameters
    ----------
    length: integer
        Typed array length.

    dtype: string (optional)
        Data type. Default: 'float64'.

    Returns
    -------
    out: TypedArray|null
        If the function is unable to allocate a typed array from the typed array
        pool (e.g., due to insufficient memory), the function returns `null`.

    Examples
    --------
    > var arr = {{alias}}.calloc( 5 )
    <Float64Array>[ 0.0, 0.0, 0.0, 0.0, 0.0 ]
    > arr = {{alias}}.calloc( 5, 'int32' )
    <Int32Array>[ 0, 0, 0, 0, 0 ]


{{alias}}.free( buf )
    Frees a typed array or typed array buffer for use in a future allocation.

    Parameters
    ----------
    buf: TypedArray|ArrayBuffer
        Typed array or typed array buffer to free.

    Examples
    --------
    > var arr = {{alias}}( 5 )
    <Float64Array>
    > {{alias}}.free( arr )


{{alias}}.clear()
    Clears the typed array pool allowing garbage collection of previously
    allocated (and currently free) array buffers.

    Examples
    --------
    > var arr = {{alias}}( 5 )
    <Float64Array>
    > {{alias}}.free( arr );
    > {{alias}}.clear()


{{alias}}.highWaterMark
    Read-only property returning the pool's high water mark.

    Once a high water mark is reached, typed array allocation fails.

    Examples
    --------
    > {{alias}}.highWaterMark


{{alias}}.nbytes
    Read-only property returning the total number of allocated bytes.

    The returned value is the total accumulated value. Hence, anytime a pool
    must allocate a new array buffer (i.e., more memory), the pool increments
    this value.

    The only time this value is decremented is when a pool is cleared.

    This behavior means that, while allocated buffers which are never freed may,
    in fact, be garbage collected, they continue to count against the high water
    mark limit.

    Accordingly, you should *always* free allocated buffers in order to prevent
    the pool from believing that non-freed buffers are continually in use.

    Examples
    --------
    > var arr = {{alias}}( 5 )
    <Float64Array>
    > {{alias}}.nbytes


{{alias}}.factory( [options] )
    Creates a typed array pool.

    Parameters
    ----------
    options: Object (optional)
        Function options.

    options.highWaterMark: integer (optional)
        Maximum total memory (in bytes) which can be allocated.

    Returns
    -------
    fcn: Function
        Function for creating typed arrays from a typed array memory pool.

    Examples
    --------
    > var pool = {{alias}}.factory();
    > var arr1 = pool( 3, 'float64' )
    <Float64Array>

    See Also
    --------