#ifndef _clause_hpp_INCLUDED #define _clause_hpp_INCLUDED struct clause_store { int size, lbd; int *data; std::atomic refs; clause_store(int sz) { size = sz; data = (int*) malloc(sizeof(int) * sz); lbd = 0; refs = 1; } void increase_refs(int inc) { refs += inc; } bool free_clause() { int ref = refs.fetch_sub(1); if (ref <= 1) { // for (int i = 0; i < size; i++) // printf("%d ", data[i]); // puts(""); free(data); return true; } return false; } ~clause_store() { puts("free"); } }; #endif