eosio.cdt
eosio.cdt copied to clipboard
problems using freeing allocator
Take this contract:
#include <eosio/eosio.hpp>
using namespace eosio;
class [[eosio::contract]] membloat : public contract {
public:
using contract::contract;
[[eosio::action]]
void nomnomnom() {
for(size_t i = 0; i < 20000; ++i) {
char* p = (char*)malloc(100000);
eosio::check(p, "malloc failed yo");
free(p);
}
}
};
Compile via
~/cdt/bin/eosio-cpp membloat.cpp -o membloat.o -contract membloat -c
~/cdt/bin/eosio-ld membloat.o -o membloat.wasm -use-freeing-malloc
Expected behavior: runs to completion Observed behavior: access violation