Sha256: f4b77b4e0beee8258e7d097123bc03aa386737c8a184884ccaca1351f7e64fd9

Contents?: true

Size: 567 Bytes

Versions: 11

Compression:

Stored size: 567 Bytes

Contents

static VALUE
<%=c_func(0)%>(VALUE self)
{
    narray_t *na;
    char *ptr;

    GetNArray(self,na);

    switch(NA_TYPE(na)) {
    case NARRAY_DATA_T:
        ptr = NA_DATA_PTR(na);
        if (na->size > 0 && ptr == NULL) {
            ptr = xmalloc(((na->size-1)/8/sizeof(BIT_DIGIT)+1)*sizeof(BIT_DIGIT));
            NA_DATA_PTR(na) = ptr;
        }
        break;
    case NARRAY_VIEW_T:
        rb_funcall(NA_VIEW_DATA(na), rb_intern("allocate"), 0);
        break;
    default:
        rb_raise(rb_eRuntimeError,"invalid narray type");
    }
    return self;
}

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
numo-narray-0.9.1.5 ext/numo/narray/gen/tmpl_bit/allocate.c
numo-narray-0.9.1.4 ext/numo/narray/gen/tmpl_bit/allocate.c
numo-narray-0.9.1.3 ext/numo/narray/gen/tmpl_bit/allocate.c
numo-narray-0.9.1.2 ext/numo/narray/gen/tmpl_bit/allocate.c
numo-narray-0.9.1.1 ext/numo/narray/gen/tmpl_bit/allocate.c
numo-narray-0.9.1.0 ext/numo/narray/gen/tmpl_bit/allocate.c
numo-narray-0.9.0.9 ext/numo/narray/gen/tmpl_bit/allocate.c
numo-narray-0.9.0.8 ext/numo/narray/gen/tmpl_bit/allocate.c
numo-narray-0.9.0.7 ext/numo/narray/gen/tmpl_bit/allocate.c
numo-narray-0.9.0.6 ext/numo/narray/gen/tmpl_bit/allocate.c
numo-narray-0.9.0.5 ext/numo/narray/gen/tmpl_bit/allocate.c