1 // cl_make_heap_SV_ringelt().
6 CL_PROVIDE(cl_SV_ringelt)
9 #include "cl_SV_ringelt.h"
17 static void cl_svector_ringelt_destructor (cl_heap* pointer)
19 #if (defined(__mips__) || defined(__mips64__)) && !defined(__GNUC__) // workaround SGI CC bug
20 (*(cl_heap_SV_ringelt*)pointer).~cl_heap_SV();
22 (*(cl_heap_SV_ringelt*)pointer).~cl_heap_SV_ringelt();
26 cl_class cl_class_svector_ringelt = {
27 cl_svector_ringelt_destructor,
31 cl_heap_SV_ringelt* cl_make_heap_SV_ringelt_uninit (uintL len)
33 var cl_heap_SV_ringelt* hv = (cl_heap_SV_ringelt*) cl_malloc_hook(sizeof(cl_heap_SV_ringelt)+sizeof(_cl_ring_element)*len);
35 hv->type = &cl_class_svector_ringelt;
36 new (&hv->v) cl_SV_inner<_cl_ring_element> (len);
37 // Have to fill hv->v[i] (0 <= i < len) yourself.
41 cl_heap_SV_ringelt* cl_make_heap_SV_ringelt (uintL len)
43 var cl_heap_SV_ringelt* hv = (cl_heap_SV_ringelt*) cl_malloc_hook(sizeof(cl_heap_SV_ringelt)+sizeof(_cl_ring_element)*len);
45 hv->type = &cl_class_svector_ringelt;
46 new (&hv->v) cl_SV_inner<_cl_ring_element> (len);
47 for (var uintL i = 0; i < len; i++)
48 init1(_cl_ring_element, hv->v[i]) ();
53 const cl_SV_ringelt cl_null_SV_ringelt = cl_SV_ringelt((uintL)0);
55 CL_PROVIDE_END(cl_SV_ringelt)