1 // cl_make_heap_SV_ringelt().
7 #include "cln/SV_ringelt.h"
14 static void cl_svector_ringelt_destructor (cl_heap* pointer)
16 #if (defined(__mips__) || defined(__mips64__)) && !defined(__GNUC__) // workaround SGI CC bug
17 (*(cl_heap_SV_ringelt*)pointer).~cl_heap_SV();
19 (*(cl_heap_SV_ringelt*)pointer).~cl_heap_SV_ringelt();
23 // XXX: this ought to be static const, but it would be impossible to
24 // set the printing function (see cl_SV_ringelt_debug.cc)
25 cl_class& cl_class_svector_ringelt()
27 static cl_class instance = {
28 cl_svector_ringelt_destructor,
34 cl_heap_SV_ringelt* cl_make_heap_SV_ringelt_uninit (uintC len)
36 var cl_heap_SV_ringelt* hv = (cl_heap_SV_ringelt*) malloc_hook(sizeof(cl_heap_SV_ringelt)+sizeof(_cl_ring_element)*len);
38 hv->type = &cl_class_svector_ringelt();
39 new (&hv->v) cl_SV_inner<_cl_ring_element> (len);
40 // Have to fill hv->v[i] (0 <= i < len) yourself.
44 cl_heap_SV_ringelt* cl_make_heap_SV_ringelt (uintC len)
46 var cl_heap_SV_ringelt* hv = (cl_heap_SV_ringelt*) malloc_hook(sizeof(cl_heap_SV_ringelt)+sizeof(_cl_ring_element)*len);
48 hv->type = &cl_class_svector_ringelt();
49 new (&hv->v) cl_SV_inner<_cl_ring_element> (len);
50 for (var uintC i = 0; i < len; i++)
51 init1(_cl_ring_element, hv->v[i]) ();
56 const cl_SV_ringelt cl_null_SV_ringelt = cl_null_SV_ringelt;
58 int cl_SV_ringelt_init_helper::count = 0;
60 cl_SV_ringelt_init_helper::cl_SV_ringelt_init_helper()
63 new ((void *)&cl_null_SV_ringelt) cl_SV_ringelt((uintC)0);
66 cl_SV_ringelt_init_helper::~cl_SV_ringelt_init_helper()
69 // Nothing to clean up here