Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Activation_Record Struct Reference

Activation record structure for stack-based Fibonacci. More...

Public Attributes

int n
 Parameter: which Fibonacci number to compute.
 
long long f1
 Local variable: stores result of fib(n-1)
 
long long result
 Return value to pass to caller.
 
char return_point
 Continuation: where to resume after return.
 

Detailed Description

Activation record structure for stack-based Fibonacci.

This structure represents a stack frame (activation record) containing:

  • n: The parameter for this invocation of fib()
  • f1: Storage for the result of the first recursive call fib(n-1)
  • result: The computed result to return to caller
  • return_point: Which label to jump to when returning (P1 or P2)

This mirrors exactly what the compiler generates for each function call.

Definition at line 263 of file fibonacci.C.

Member Data Documentation

◆ f1

long long Activation_Record::f1

Local variable: stores result of fib(n-1)

Definition at line 266 of file fibonacci.C.

◆ n

int Activation_Record::n

Parameter: which Fibonacci number to compute.

Definition at line 265 of file fibonacci.C.

◆ result

long long Activation_Record::result

Return value to pass to caller.

Definition at line 267 of file fibonacci.C.

◆ return_point

char Activation_Record::return_point

Continuation: where to resume after return.

Definition at line 268 of file fibonacci.C.


The documentation for this struct was generated from the following file: