Skip to content

Commit

Permalink
fix: set correct svecf32 header while creating SVecf32Output (#590)
Browse files Browse the repository at this point in the history
Signed-off-by: usamoi <[email protected]>
  • Loading branch information
usamoi authored Sep 5, 2024
1 parent 2e20358 commit 8abfd82
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/datatype/memory_svecf32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ impl SVecf32Output {
let ptr = pgrx::pg_sys::palloc(layout.size()) as *mut SVecf32Header;
ptr.cast::<u8>().add(layout.size() - 8).write_bytes(0, 8);
std::ptr::addr_of_mut!((*ptr).varlena).write(SVecf32Header::varlena(layout.size()));
std::ptr::addr_of_mut!((*ptr).reserved).write(0);
std::ptr::addr_of_mut!((*ptr).magic).write(HEADER_MAGIC);
std::ptr::addr_of_mut!((*ptr).dims).write(vector.dims());
std::ptr::addr_of_mut!((*ptr).magic).write(2);
std::ptr::addr_of_mut!((*ptr).len).write(vector.len());
std::ptr::addr_of_mut!((*ptr).reserved).write(HEADER_MAGIC);
let mut data_ptr = (*ptr).phantom.as_mut_ptr().cast::<u32>();
std::ptr::copy_nonoverlapping(
vector.indexes().as_ptr(),
Expand Down

0 comments on commit 8abfd82

Please sign in to comment.