# Changeset 18783b4

Ignore:
Timestamp:
Sep 4, 2021, 10:34:43 PM (3 years ago)
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
49b3389
Parents:
f450f2f
Message:

attempt to remove tail-recursion optimization

Location:
doc/theses/andrew_beach_MMath/code
Files:
5 edited

Unmodified
Removed
• ## doc/theses/andrew_beach_MMath/code/fixup-empty-f.cfa

 rf450f2f #include                                                                    // strto int nounwind_fixup(unsigned int frames, void (*raised_rtn)(int &)) { void nounwind_fixup(unsigned int frames, void (*raised_rtn)(int &)) { if (frames) { int rtn = nounwind_fixup(frames - 1, raised_rtn); if ( rtn == 42 ) printf( "42" );                                // make non-tail recursive return rtn; nounwind_fixup(frames - 1, raised_rtn); if ( frames == -1 ) printf( "42" );                             // prevent recursion optimizations } else { int fixup = 17; raised_rtn(fixup); return fixup; } }
• ## doc/theses/andrew_beach_MMath/code/fixup-empty-r.cfa

 rf450f2f vtable(fixup_exception) fixup_vt; int nounwind_empty(unsigned int frames) { void nounwind_empty(unsigned int frames) { if (frames) { int rtn = nounwind_empty(frames - 1); if ( rtn == 42 ) printf( "42" );                                // make non-tail recursive return rtn; nounwind_empty(frames - 1); if ( frames == -1 ) printf( "42" );                             // prevent recursion optimizations } else { int fixup = 17; throwResume (fixup_exception){&fixup_vt, fixup}; // change bad fixup return fixup; } }
• ## doc/theses/andrew_beach_MMath/code/fixup-other-f.cfa

 rf450f2f frames -= 1; nounwind_fixup(42, raised_rtn, not_raised); if ( frames == -1 ) printf( "42" );                             // prevent recursion optimizations } else { int fixup = dummy;
• ## doc/theses/andrew_beach_MMath/code/fixup-other-r.cfa

 rf450f2f try { nounwind_other(42); if ( frames == -1 ) printf( "42" );                     // prevent recursion optimizations } catchResume (not_raised_exception * ex) { ex->fixup = frames + 42;                                        // use local scope => lexical link
• ## doc/theses/andrew_beach_MMath/code/resume-empty.cfa

 rf450f2f if (frames) { nounwind_empty(frames - 1); if ( frames == -1 ) printf( "42" );                             // prevent recursion optimizations } else { throwResume (empty_exception){&empty_vt};
Note: See TracChangeset for help on using the changeset viewer.