Make StringValue's memory layout same with Slice (#1712)
In our storage engine's code, we cast StringValue to Slice. Because their memory layout is different, it may cause BE process crash. We make their memory layout same in this patch to resolve this problem temporary. We should improve it some day.
This commit is contained in:
@ -33,8 +33,11 @@ struct StringValue {
|
||||
// TODO: change ptr to an offset relative to a contiguous memory block,
|
||||
// so that we can send row batches between nodes without having to swizzle
|
||||
// pointers
|
||||
// NOTE: This struct should keep the same memory layout with Slice, otherwise
|
||||
// it will lead to BE crash.
|
||||
// TODO(zc): we should unify this struct with Slice some day.
|
||||
char* ptr;
|
||||
int len;
|
||||
size_t len;
|
||||
|
||||
StringValue(char* ptr, int len): ptr(ptr), len(len) {}
|
||||
StringValue(): ptr(NULL), len(0) {}
|
||||
|
||||
Reference in New Issue
Block a user