Skip to content
Tcl Source Code Changes To byteArray Object Type
Login

Changes To byteArray Object Type

Changes to "byteArray Object Type" between 2014-09-23 18:09:08 and 2016-09-24 15:45:59

︙
23
24
25
26
27
28
29













23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42







+
+
+
+
+
+
+
+
+
+
+
+
+

<h1>Discussion</h1>

The rest of the file implements the [binary] command.

The public routines have similar INT_MAX size limitations to
other parts of Tcl.

The type is implemented by a pointer in the <tt>ptr1</tt> field of the <tt>internalRep</tt>; that points to a <tt>ByteArray</tt> structure with the following declaration (NB: normative declaration is in the code).
<pre>
typedef struct ByteArray {
    int used;			/* The number of bytes used in the byte
				 * array. */
    int allocated;		/* The amount of space actually allocated
				 * minus 1 byte. */
    unsigned char bytes[];	/* The array of bytes. The actual size of this
				 * field depends on the 'allocated' field
				 * above. */
} ByteArray;
</pre>