Whiley / RFCs

Request for Comment (RFC) proposals for substantial changes to the Whiley language.
3 stars 2 forks source link

Unsized Arrays are Linear #75

Open DavePearce opened 4 years ago

DavePearce commented 4 years ago

(See RFC#0003

This is just an observation based around the following assumption:

  1. Unsized arrays (e.g. int[?]) should compile down to C arrays

If this assumption is to hold, then we cannot automatically copy such arrays as do not know their size. This means they are by construction linear in nature. Of course, if we know certain things about them, then we can exploit this to copy parts, etc.