Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion rbc/heavydb/buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from rbc import typesystem
from rbc.targetinfo import TargetInfo

from .allocator import allocate_varlen_buffer
from .metatype import HeavyDBMetaType

int8_t = ir.IntType(8)
Expand Down Expand Up @@ -209,7 +210,10 @@ def heavydb_buffer_constructor(context, builder, sig, args):
ptr = memalloc(context, builder, ptr_type, element_count, element_size)

llty = context.get_value_type(sig.return_type.dtype)
st_ptr = builder.alloca(llty)
st_size = context.get_abi_sizeof(llty)
st_ptr = builder.bitcast(allocate_varlen_buffer(builder, int64_t(st_size),
int64_t(1)),
llty.as_pointer())

zero, one, two = int32_t(0), int32_t(1), int32_t(2)
builder.store(ptr, builder.gep(st_ptr, [zero, zero]))
Expand Down
7 changes: 5 additions & 2 deletions rbc/heavydb/text_encoding_none.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

from rbc import typesystem

from .allocator import allocate_varlen_buffer
from .array import ArrayPointer
from .buffer import Buffer, HeavyDBBufferType, heavydb_buffer_constructor
from .allocator import allocate_varlen_buffer

i8 = ir.IntType(8)
i8p = i8.as_pointer()
Expand Down Expand Up @@ -176,7 +176,10 @@ def text_encoding_none_unicode_ctor(context, builder, sig, args):
uni_str = context.make_helper(builder, sig.args[0], value=args[0])

llty = context.get_value_type(sig.return_type.dtype)
st_ptr = builder.alloca(llty)
st_size = context.get_abi_sizeof(llty)
st_ptr = builder.bitcast(allocate_varlen_buffer(builder, int64_t(st_size),
int64_t(1)),
llty.as_pointer())
zero, one, two = i32(0), i32(1), i32(2)

eq = builder.icmp_signed('==', uni_str.length, uni_str.length.type(0))
Expand Down