MCPcopy Create free account
hub / github.com/ReadyTalk/avian / makeByteArrayV

Function makeByteArrayV

src/machine.cpp:4355–4367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4353}
4354
4355GcByteArray* makeByteArrayV(Thread* t, const char* format, va_list a, int size)
4356{
4357 THREAD_RUNTIME_ARRAY(t, char, buffer, size);
4358
4359 int r = vm::vsnprintf(RUNTIME_ARRAY_BODY(buffer), size - 1, format, a);
4360 if (r >= 0 and r < size - 1) {
4361 GcByteArray* s = makeByteArray(t, strlen(RUNTIME_ARRAY_BODY(buffer)) + 1);
4362 memcpy(s->body().begin(), RUNTIME_ARRAY_BODY(buffer), s->length());
4363 return s;
4364 } else {
4365 return 0;
4366 }
4367}
4368
4369GcByteArray* makeByteArray(Thread* t, const char* format, ...)
4370{

Callers 3

makeByteArrayFunction · 0.85
makeStringFunction · 0.85
makeThrowableVFunction · 0.85

Calls 5

vsnprintfFunction · 0.85
makeByteArrayFunction · 0.85
bodyMethod · 0.80
lengthMethod · 0.65
beginMethod · 0.45

Tested by

no test coverage detected