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