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