1 // cl_make_heap_SV_ringelt().
6 CL_PROVIDE(cl_SV_ringelt)
9 #include "cln/SV_ringelt.h"
14 #include "cln/abort.h"
18 static void cl_svector_ringelt_destructor (cl_heap* pointer)
20 #if (defined(__mips__) || defined(__mips64__)) && !defined(__GNUC__) // workaround SGI CC bug
21 (*(cl_heap_SV_ringelt*)pointer).~cl_heap_SV();
23 (*(cl_heap_SV_ringelt*)pointer).~cl_heap_SV_ringelt();
27 cl_class cl_class_svector_ringelt = {
28 cl_svector_ringelt_destructor,
32 cl_heap_SV_ringelt* cl_make_heap_SV_ringelt_uninit (uintL len)
34 var cl_heap_SV_ringelt* hv = (cl_heap_SV_ringelt*) malloc_hook(sizeof(cl_heap_SV_ringelt)+sizeof(_cl_ring_element)*len);
36 hv->type = &cl_class_svector_ringelt;
37 new (&hv->v) cl_SV_inner<_cl_ring_element> (len);
38 // Have to fill hv->v[i] (0 <= i < len) yourself.
42 cl_heap_SV_ringelt* cl_make_heap_SV_ringelt (uintL len)
44 var cl_heap_SV_ringelt* hv = (cl_heap_SV_ringelt*) malloc_hook(sizeof(cl_heap_SV_ringelt)+sizeof(_cl_ring_element)*len);
46 hv->type = &cl_class_svector_ringelt;
47 new (&hv->v) cl_SV_inner<_cl_ring_element> (len);
48 for (var uintL i = 0; i < len; i++)
49 init1(_cl_ring_element, hv->v[i]) ();
54 const cl_SV_ringelt cl_null_SV_ringelt = cl_SV_ringelt((uintL)0);
58 CL_PROVIDE_END(cl_SV_ringelt)