Changeset 804bf677 for tests/collections
- Timestamp:
- Oct 13, 2021, 9:52:02 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
- Children:
- 7b0e8b7
- Parents:
- 4b3b352
- Location:
- tests/collections
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/collections/.expect/string-ctx-manage.txt
r4b3b352 r804bf677 3 3 hi 4 4 bye 5 hi 5 6 done -
tests/collections/string-ctx-manage.cfa
r4b3b352 r804bf677 24 24 sout | y; // hi 25 25 26 x = "bye"; //.... Bookmark 9/30 shallow: surprisingly this step failed26 x = "bye"; 27 27 y = x; // y was already in different context => eager copy 28 28 assert( y.inner->Handle.s != x.inner->Handle.s); … … 30 30 } 31 31 32 void failSoloAlloc() {32 void soloAlloc() { 33 33 string x = "hi"; 34 34 string_sharectx c = { NO_SHARING }; 35 36 string y = x; // y allocates into private pad, implying eager copy 37 assert( y.inner->Handle.s != x.inner->Handle.s); 38 sout | y; // hi 35 39 36 // want: allocation into private pad, with forced eager copy into it 37 // got: assertion failure, "Need to implement private contexts" 38 string y = x; 40 // -- following hits "need to implement actual growth" 41 // and it passes if I modify string_res.cfa to oversize the owned heaps 42 43 // x = "bye"; 44 // y = x; // into private y => eager copy 45 // assert( y.inner->Handle.s != x.inner->Handle.s); 46 // sout | y; // bye 39 47 } 40 48 41 volatile bool showFail = false;42 49 43 50 int main() { 44 51 baseline(); 45 52 eagerCopy(); 46 if (showFail) { 47 failSoloAlloc(); 48 } 53 soloAlloc(); 49 54 printf("done\n"); 50 55 }
Note: See TracChangeset
for help on using the changeset viewer.