mirror of
https://github.com/logos-blockchain/logos-blockchain-circuits.git
synced 2026-05-18 23:39:47 +00:00
Split shared free_bytes into common source and fix ffi includes.
This commit is contained in:
parent
dfe86c6282
commit
2e1dd99ac5
13
src/common.cpp
Normal file
13
src/common.cpp
Normal file
@ -0,0 +1,13 @@
|
||||
#include "types.hpp"
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
extern "C" void free_bytes(Bytes* bytes) {
|
||||
if (bytes == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
free(bytes->data);
|
||||
bytes->data = nullptr;
|
||||
bytes->size = 0;
|
||||
}
|
||||
19
src/ffi.cpp
19
src/ffi.cpp
@ -1,15 +1,14 @@
|
||||
#include "ffi.hpp."
|
||||
#include "ffi.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include "calcwit.hpp."
|
||||
#include "circom.hpp."
|
||||
#include "fr.hpp."
|
||||
#include "calcwit.hpp"
|
||||
#include "circom.hpp"
|
||||
#include "fr.hpp"
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
@ -132,13 +131,3 @@ extern "C" Status generate_witness(const WitnessInput* input, Bytes* output) {
|
||||
return generate_witness_impl(input, output);
|
||||
});
|
||||
}
|
||||
|
||||
extern "C" void free_bytes(Bytes* bytes) {
|
||||
if (bytes == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
free(bytes->data);
|
||||
bytes->data = nullptr;
|
||||
bytes->size = 0;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user