Memory Allocation With Doevents

When a procedure utilizes doevents, this means that its execution gets interrupted and other event chains get executed while this procedure is on hold.

As a result, a procedure with doevents in it, as well as all procedures in the chain leading to this procedure, cannot share any memory space with other call chains in the project.

Here is the already familiar call chain example from the Memory Allocation topic. This time, the wroom() procedure contains the doevents statement.

A block diagram illustrating memory allocation with the doevents statement.

Since the doevents statement is in wroom(), both this procedure and all procedures leading to it (just the on_sock_event() in my example) will be allocated exclusive memory:

A block diagram illustrating the memory allocation for the doevents statement and the procedures leading to it.