File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: c3bf7d07e98109a1143567a3c658cadf387febeb
2
+ refs/heads/master: 355c417267371293f48333388fed7eb56c3a8b1f
Original file line number Diff line number Diff line change @@ -585,12 +585,23 @@ upcall_ivec_resize(rust_task *task,
585
585
task->fail (4 );
586
586
}
587
587
588
+ /* *
589
+ * Spills an interior vector to the heap.
590
+ */
588
591
extern " C" CDECL void
589
592
upcall_ivec_spill (rust_task *task,
590
593
rust_ivec *v,
591
594
size_t newsz) {
592
- // TODO
593
- task->fail (4 );
595
+ size_t new_alloc = next_power_of_two (newsz);
596
+
597
+ rust_ivec_heap *heap_part = (rust_ivec_heap *)
598
+ task->malloc (new_alloc + sizeof (size_t ));
599
+ heap_part->fill = newsz;
600
+ memcpy (&heap_part->data , v->payload .data , v->fill );
601
+
602
+ v->fill = 0 ;
603
+ v->alloc = new_alloc;
604
+ v->payload .ptr = heap_part;
594
605
}
595
606
596
607
//
You can’t perform that action at this time.
0 commit comments