MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / c_str

Method c_str

src/misc/string_writer.cpp:140–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138 }
139
140 char * TextWriter::c_str() {
141 if ( size < capacity ) {
142 largeBuffer[size] = 0;
143 return largeBuffer;
144 } else {
145 char * newBuffer = (char *) das_aligned_alloc16(size + 1);
146 memcpy(newBuffer, largeBuffer, size);
147 newBuffer[size] = 0;
148 if ( largeBuffer != fixedBuffer ) {
149 das_aligned_free16(largeBuffer);
150 }
151 largeBuffer = newBuffer;
152 capacity = size + 1;
153 return largeBuffer;
154 }
155 }
156
157 char * TextWriter::allocate (int l) {
158 // keep data in the fixed buffer, if it fits

Callers 15

pugiDocumentSaveToStringFunction · 0.45
pugiNodePathFunction · 0.45
pugiNodePrintFunction · 0.45
pugiXPathEvaluateStringFunction · 0.45
compare_eqMethod · 0.45
compare_relMethod · 0.45
eval_booleanMethod · 0.45
eval_numberMethod · 0.45
eval_string_concatMethod · 0.45
eval_stringMethod · 0.45

Calls 2

das_aligned_alloc16Function · 0.85
das_aligned_free16Function · 0.85

Tested by 2

transformCallMethod · 0.36
print_das_stack_walkFunction · 0.36