- Timestamp:
- Mar 20, 2025, 1:06:08 AM (3 days ago)
- Branches:
- master
- Children:
- f5bf3c2
- Parents:
- 5329cba
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified doc/theses/mike_brooks_MMath/programs/sharectx.run.cfa ¶
r5329cba r62b5940 1 1 #include <string.hfa> 2 2 #include <string_sharectx.hfa> 3 4 void a() {}5 void b() {}6 void c() {}7 void d() {}8 void e() {}9 3 10 4 … … 14 8 15 9 16 17 18 19 20 void helper2() { 21 c(); 22 string_sharectx c = {NEW_SHARING}; 23 d(); 10 void a( string & sm ) { 11 string sm_a = sm; // share 24 12 } 25 void helper1() { 26 a(); 27 string_sharectx c = {NO_SHARING}; 28 b(); 29 helper2(); 30 e(); 13 void b( string & sm ) { 14 string sm_b = sm; // share 15 } 16 void c( string & sm, string & sh1 ) { 17 string sm_c = sm; // copy 18 string sh1_c = sh1; // copy 19 } 20 void d( string & sm, string & sh1 ) { 21 string sm_d = sm; // copy 22 string sh1_d = sh1; // copy 23 } 24 void e( string & sm, string & sh1, string & sh2 ) { 25 string sm_e = sm; // copy 26 string sh1_e = sh1; // copy 27 string sh2_e = sh2; // share 28 } 29 void f( string & sm, string & sh1 ) { 30 string sm_f = sm; // copy 31 string sh1_f = sh1; // copy 32 } 33 void g( string & sm ) { 34 string sm_g = sm; // share 35 } 36 void helper2( string & sm, string & sh1 ) { 37 d( sm, sh1 ); 38 string_sharectx ctx_on = {NEW_SHARING}; 39 string sh2 = "sh2"; 40 e( sm, sh1, sh2 ); 41 } 42 void helper1( string & sm ) { 43 b( sm ); 44 string_sharectx ctx_off = {NO_SHARING}; 45 string sh1 = "sh1"; 46 c( sm, sh1 ); 47 helper2( sm, sh1 ); 48 f( sm, sh1 ); 31 49 } 32 50 int main() { 33 helper1(); 51 string sm = "sm"; 52 a( sm ); 53 helper1( sm ); 54 g( sm ); 34 55 } 35
Note: See TracChangeset
for help on using the changeset viewer.