Close

anti-break do()

A project log for A stack.

It started as a software data stack. Because I need it. It has become a hardware control stack.

yann-guidon-ygdesYann Guidon / YGDES 04/12/2025 at 00:270 Comments

I added an inner loop inside the DS_MARK-DS_RELEASE macro :

// The inseparable pair :
#define DS_MARK                      \
do {                                 \
  datastack_mark_type mark_variable; \
  DO_MARK(mark_variable);            \
  do {

// double-loop prevents break from skipping the release

#define DS_RELEASE                            \
  } while(0);                                 \
  scan_destructors(mark_variable.destructor); \
  DO_RELEASE(mark_variable);                  \
} while(0);

It only occurred to me that a break between the two macros would skip the release... now it's fixed.

Discussions