Changeset 54651005 for doc/theses/andrew_beach_MMath/code/resume-detor.cfa
- Timestamp:
- Jul 20, 2021, 3:31:20 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 86fc350
- Parents:
- 815c6ae
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/code/resume-detor.cfa
r815c6ae r54651005 12 12 13 13 void ^?{}(WithDestructor & this) { 14 // ... 14 asm volatile ("# destructor body"); 15 15 } 16 16 17 17 void unwind_destructor(unsigned int frames) { 18 18 if (frames) { 19 19 20 21 22 23 24 20 WithDestructor object; 21 unwind_destructor(frames - 1); 22 } else { 23 throwResume (empty_exception){&empty_vt}; 24 } 25 25 } 26 26 … … 36 36 37 37 Time start_time = timeHiRes(); 38 39 40 41 42 // ... 43 44 38 for (int count = 0 ; count < times ; ++count) { 39 try { 40 unwind_destructor(total_frames); 41 } catchResume (empty_exception *) { 42 asm volatile ("# fixup block"); 43 } 44 } 45 45 Time end_time = timeHiRes(); 46 46 sout | "Run-Time (ns): " | (end_time - start_time)`ns;
Note: See TracChangeset
for help on using the changeset viewer.