Minimal pycapnp

This commit is contained in:
Adeeb Shihadeh
2026-09-21 18:57:37 -07:00
parent a0cb5cdf06
commit 5befba15f3
125 changed files with 423 additions and 14793 deletions

View File

@@ -1,14 +0,0 @@
#pragma once
#include "kj/io.h"
#include "capnp/dynamic.h"
#include "capnp/serialize-packed.h"
kj::Array< ::capnp::byte> messageToPackedBytes(capnp::MessageBuilder & message, size_t wordCount)
{
kj::Array<capnp::byte> result = kj::heapArray<capnp::byte>(wordCount * 8);
kj::ArrayOutputStream out(result.asPtr());
capnp::writePackedMessage(out, message);
return heapArray(out.getArray()); // TODO: make this non-copying somehow
}