ExplicitString¶
Usage
use ExplicitString;
-
record
String
¶ Due to behavior of _string (Chapel’s native string type) that:
- Creates a full on copy of the string on assignment even if it is not needed.
Leaks the implicit string copy if stored in a Chapel array that never shrinks
Naively rehashes the string and does not cache the hash, hence resulting in excess implicit copies and remote transfers
These issues have also been confirmed by Michael Ferguson (@mppf); hence to get around this, this module features a new ‘String’ type that does not create any implicit copies. This is necessary not only for performance but also space overhead.
-
var
data
: _ddata(uint(8))¶
-
var
dataLen
: int(64)¶
-
var
hash
: uint(64)¶
-
proc
init
()¶
-
proc
init=
(other: String)¶
-
proc
init
(str: string)
-
proc
toString
()¶
-
proc
readWriteThis
(f)¶
-
proc
destroy
()¶
-
proc
+
(str1: string, str2: String): string¶
-
proc
+
(str1: String, str2: String): string
-
proc
+
(str1: String, str2: string): string
-
proc
==
(str1: String, str2: String): bool¶