Files
bolar_2/main/ports/memory_cache.h
2026-11-27 16:38:11 +08:00

20 lines
614 B
C++

#pragma once
#include "memory/memory_types.h"
namespace borla {
class IMemoryCache {
public:
virtual ~IMemoryCache() = default;
virtual bool Load() = 0;
// Deliberately an out-parameter rather than a by-value return: a returned
// MemorySnapshot materialises a ~2 KB temporary in the caller's frame, and
// the only caller is the WebSocket/TLS task building ClientHello, whose
// stack cannot absorb that on top of the message buffer.
virtual void CopySnapshot(MemorySnapshot* output) const = 0;
virtual bool Update(const MemorySnapshot& snapshot) = 0;
};
} // namespace borla