Re: [swift-dev] statically initialized arrays

2017-06-19 Thread Joe Groff via swift-dev
> On Jun 19, 2017, at 1:45 PM, Erik Eckstein wrote: > >> >> On Jun 19, 2017, at 8:53 AM, Joe Groff wrote: >> >>> >>> On Jun 14, 2017, at 11:24 AM, Erik Eckstein via swift-dev >>> wrote: >>> >>> Hi, >>> >>> I’m about implementing statically initialized arrays. It’s about allocating >>> s

Re: [swift-dev] statically initialized arrays

2017-06-19 Thread Erik Eckstein via swift-dev
> On Jun 19, 2017, at 8:53 AM, Joe Groff wrote: > >> >> On Jun 14, 2017, at 11:24 AM, Erik Eckstein via swift-dev >> wrote: >> >> Hi, >> >> I’m about implementing statically initialized arrays. It’s about allocating >> storage for arrays in the data section rather than on the heap. >> >>

Re: [swift-dev] statically initialized arrays

2017-06-19 Thread Greg Parker via swift-dev
> On Jun 19, 2017, at 9:58 AM, Joe Groff wrote: > >> On Jun 15, 2017, at 8:30 PM, Greg Parker via swift-dev >> wrote: >> >> swift_once is not the most efficient solution here - we don't need separate >> once token storage in this case - but it's fine for now. If necessary we can >> get rid

Re: [swift-dev] statically initialized arrays

2017-06-19 Thread Joe Groff via swift-dev
> On Jun 15, 2017, at 8:30 PM, Greg Parker via swift-dev > wrote: > >> >> On Jun 15, 2017, at 4:39 PM, Andrew Trick via swift-dev >> wrote: >> >>> On Jun 15, 2017, at 4:26 PM, Andrew Trick wrote: >>> On Jun 14, 2017, at 12:03 PM, Jordan Rose via swift-dev wrote: > ad

Re: [swift-dev] statically initialized arrays

2017-06-19 Thread Joe Groff via swift-dev
> On Jun 14, 2017, at 11:24 AM, Erik Eckstein via swift-dev > wrote: > > Hi, > > I’m about implementing statically initialized arrays. It’s about allocating > storage for arrays in the data section rather than on the heap. > > Info: the array storage is a heap object. So in the following I’m

Re: [swift-dev] statically initialized arrays

2017-06-19 Thread Joe Groff via swift-dev
> On Jun 14, 2017, at 11:24 AM, Erik Eckstein via swift-dev > wrote: > > Hi, > > I’m about implementing statically initialized arrays. It’s about allocating > storage for arrays in the data section rather than on the heap. > > Info: the array storage is a heap object. So in the following I’m

Re: [swift-dev] statically initialized arrays

2017-06-15 Thread Andrew Trick via swift-dev
> On Jun 15, 2017, at 8:30 PM, Greg Parker wrote: > > (You can do without a separate token if (1) your storage is two pointers or > less in size, (2) your storage is sufficiently well-aligned that it does not > cross cache line boundaries, (3) your uninitialized value is zero, and (4) > your

Re: [swift-dev] statically initialized arrays

2017-06-15 Thread Greg Parker via swift-dev
> On Jun 15, 2017, at 4:39 PM, Andrew Trick via swift-dev > wrote: > >> On Jun 15, 2017, at 4:26 PM, Andrew Trick > > wrote: >> >>> On Jun 14, 2017, at 12:03 PM, Jordan Rose via swift-dev >>> mailto:swift-dev@swift.org>> wrote: >>> ad 3) IRGen support

Re: [swift-dev] statically initialized arrays

2017-06-15 Thread Greg Parker via swift-dev
> On Jun 15, 2017, at 9:24 AM, John McCall via swift-dev > wrote: > >> On Jun 15, 2017, at 10:52 AM, Arnold via swift-dev >> wrote: >> >>> On Jun 14, 2017, at 2:56 PM, Dave Abrahams via swift-dev >>> wrote: >>> on Wed Jun 14 2017, Erik Eckstein wrote: I’m about implementi

Re: [swift-dev] statically initialized arrays

2017-06-15 Thread Andrew Trick via swift-dev
> On Jun 15, 2017, at 4:26 PM, Andrew Trick wrote: > > >> On Jun 14, 2017, at 12:03 PM, Jordan Rose via swift-dev > > wrote: >> >>> ad 3) IRGen support >>> >>> Generating statically initialized globals is already done today for structs >>> and tuples. >>> What’s n

Re: [swift-dev] statically initialized arrays

2017-06-15 Thread Andrew Trick via swift-dev
> On Jun 14, 2017, at 12:03 PM, Jordan Rose via swift-dev > wrote: > >> ad 3) IRGen support >> >> Generating statically initialized globals is already done today for structs >> and tuples. >> What’s needed is the handling of objects. >> In addition to creating the global itself, we also need

Re: [swift-dev] statically initialized arrays

2017-06-15 Thread Dave Abrahams via swift-dev
on Thu Jun 15 2017, Arnold wrote: >> W00t! I'd like to do the same for String, i.e. encode the entire buffer >> in the data section. I was looking for Array example code to follow but >> couldn't find it. > > We have support for constant string buffers as of PR 8701 and PR > 8692. The former P

Re: [swift-dev] statically initialized arrays

2017-06-15 Thread Dave Abrahams via swift-dev
on Thu Jun 15 2017, Arnold wrote: >> On Jun 14, 2017, at 2:56 PM, Dave Abrahams via swift-dev >> wrote: >> >> >>> on Wed Jun 14 2017, Erik Eckstein wrote: >>> >>> Hi, >>> >>> I’m about implementing statically initialized arrays. It’s about >>> allocating storage for arrays in the data sec

Re: [swift-dev] statically initialized arrays

2017-06-15 Thread John McCall via swift-dev
> On Jun 15, 2017, at 10:52 AM, Arnold via swift-dev > wrote: > > > >> On Jun 14, 2017, at 2:56 PM, Dave Abrahams via swift-dev >> wrote: >> >> >>> on Wed Jun 14 2017, Erik Eckstein wrote: >>> >>> Hi, >>> >>> I’m about implementing statically initialized arrays. It’s about >>> allocati

Re: [swift-dev] statically initialized arrays

2017-06-15 Thread Arnold via swift-dev
> On Jun 14, 2017, at 2:56 PM, Dave Abrahams via swift-dev > wrote: > > >> on Wed Jun 14 2017, Erik Eckstein wrote: >> >> Hi, >> >> I’m about implementing statically initialized arrays. It’s about >> allocating storage for arrays in the data section rather than on the >> heap. > > W00t!

Re: [swift-dev] statically initialized arrays

2017-06-15 Thread David Smith via swift-dev
> On Jun 14, 2017, at 4:04 PM, Michael Gottesman via swift-dev > wrote: > >> >> On Jun 14, 2017, at 11:24 AM, Erik Eckstein via swift-dev >> mailto:swift-dev@swift.org>> wrote: >> >> Hi, >> >> I’m about implementing statically initialized arrays. It’s about allocating >> storage for array

Re: [swift-dev] statically initialized arrays

2017-06-14 Thread Michael Gottesman via swift-dev
> On Jun 14, 2017, at 11:24 AM, Erik Eckstein via swift-dev > wrote: > > Hi, > > I’m about implementing statically initialized arrays. It’s about allocating > storage for arrays in the data section rather than on the heap. > > Info: the array storage is a heap object. So in the following I’m

Re: [swift-dev] statically initialized arrays

2017-06-14 Thread Erik Eckstein via swift-dev
> On Jun 14, 2017, at 4:04 PM, Michael Gottesman wrote: > >> >> On Jun 14, 2017, at 11:24 AM, Erik Eckstein via swift-dev >> mailto:swift-dev@swift.org>> wrote: >> >> Hi, >> >> I’m about implementing statically initialized arrays. It’s about allocating >> storage for arrays in the data sect

Re: [swift-dev] statically initialized arrays

2017-06-14 Thread Erik Eckstein via swift-dev
> On Jun 14, 2017, at 12:03 PM, Jordan Rose wrote: > > > >> On Jun 14, 2017, at 11:24, Erik Eckstein via swift-dev > > wrote: >> >> Hi, >> >> I’m about implementing statically initialized arrays. It’s about allocating >> storage for arrays in the data section rat

Re: [swift-dev] statically initialized arrays

2017-06-14 Thread Dave Abrahams via swift-dev
on Wed Jun 14 2017, Erik Eckstein wrote: > Hi, > > I’m about implementing statically initialized arrays. It’s about > allocating storage for arrays in the data section rather than on the > heap. W00t! I'd like to do the same for String, i.e. encode the entire buffer in the data section. I was

Re: [swift-dev] statically initialized arrays

2017-06-14 Thread Jordan Rose via swift-dev
> On Jun 14, 2017, at 11:24, Erik Eckstein via swift-dev > wrote: > > Hi, > > I’m about implementing statically initialized arrays. It’s about allocating > storage for arrays in the data section rather than on the heap. > > Info: the array storage is a heap object. So in the following I’m u