Merge: lib/standard/string: Added faster to_cstring method on FlatText.
authorJean Privat <jean@pryen.org>
Thu, 2 Apr 2015 16:53:11 +0000 (23:53 +0700)
committerJean Privat <jean@pryen.org>
Thu, 2 Apr 2015 16:53:11 +0000 (23:53 +0700)
commit3bf5fbeb3200200ec405c29976c533b3f428d7a5
tree34a2bad5969916d336adc7f9a5da52e3b4824066
parent3bdbd3403c23320ab59634dff8ae5286ff2dbbb1
parent80d9936a8cd19b87c94b214e0472edfecf361d22
Merge: lib/standard/string: Added faster to_cstring method on FlatText.

Adds a service for quick cstring in `FlatTexts`, this is mainly to speedup some methods like `write_native`, which takes a cstring in input.

This just creates a new pointer to the same `char*` with an offset.

Since no copy is ever made, its use is highly discouraged in extern code or in cases other than ephemereal uses of the resulting `NativeString`.

Since it adds a new intern service, it cannot be used as is in the standard library as it will need a regeneration of c_src beforehand.

Pull-Request: #1231
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>