ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
CaDiCaL::Arena Class Reference

#include <arena.hpp>

Public Member Functions

 Arena (Internal *)
 
 ~Arena ()
 
void prepare (size_t bytes)
 
bool contains (void *p) const
 
char * copy (const char *p, size_t bytes)
 
void swap ()
 

Detailed Description

Definition at line 60 of file arena.hpp.

Constructor & Destructor Documentation

◆ Arena()

CaDiCaL::Arena::Arena ( Internal * i)

Definition at line 9 of file cadical_arena.cpp.

9 {
10 memset (this, 0, sizeof *this);
11 internal = i;
12}
char * memset()
Here is the call graph for this function:

◆ ~Arena()

CaDiCaL::Arena::~Arena ( )

Definition at line 14 of file cadical_arena.cpp.

14 {
15 delete[] from.start;
16 delete[] to.start;
17}

Member Function Documentation

◆ contains()

bool CaDiCaL::Arena::contains ( void * p) const
inline

Definition at line 81 of file arena.hpp.

81 {
82 char *c = (char *) p;
83 return (from.start <= c && c < from.top) ||
84 (to.start <= c && c < to.top);
85 }
Cube * p
Definition exorList.c:222

◆ copy()

char * CaDiCaL::Arena::copy ( const char * p,
size_t bytes )
inline

Definition at line 92 of file arena.hpp.

92 {
93 char *res = to.top;
94 to.top += bytes;
95 CADICAL_assert (to.top <= to.end);
96 memcpy (res, p, bytes);
97 return res;
98 }
#define CADICAL_assert(ignore)
Definition global.h:14
char * memcpy()
Here is the call graph for this function:

◆ prepare()

void CaDiCaL::Arena::prepare ( size_t bytes)

Definition at line 19 of file cadical_arena.cpp.

19 {
20 LOG ("preparing 'to' space of arena with %zd bytes", bytes);
21 CADICAL_assert (!to.start);
22 to.top = to.start = new char[bytes];
23 to.end = to.start + bytes;
24}
#define LOG(...)

◆ swap()

void CaDiCaL::Arena::swap ( )

Definition at line 26 of file cadical_arena.cpp.

26 {
27 delete[] from.start;
28 LOG ("delete 'from' space of arena with %zd bytes",
29 (size_t) (from.end - from.start));
30 from = to;
31 to.start = to.top = to.end = 0;
32}

Member Data Documentation

◆ end

char * CaDiCaL::Arena::end

Definition at line 65 of file arena.hpp.

◆ start

char* CaDiCaL::Arena::start

Definition at line 65 of file arena.hpp.

◆ top

char * CaDiCaL::Arena::top

Definition at line 65 of file arena.hpp.


The documentation for this class was generated from the following files: