Looking for the right term, "call stacks"?

I have encountered some problems using WiFi shield so I decided to dig into the class files and made a small diagram to show the object model of Arduino software. Here is one thing that bothered me, when I repeatedly called WiFiClient.write(char), the transfer speed is extremely slow. I get that. I might be putting one character on a packet each time instead of multiple characters. I then moved on to send multiple characters with .print(char*). Speed increased to an acceptable value. So I decided to understand how .print(char*) and .write(char) are coded and how they differ so I don’t make future mistakes. I came up with the following diagram that I NEED A FORMAL TERM for. I bet the hardcore programmers will see this as naive but I can’t remember all the following so may as well create this diagram and help other casual programmers remember.

The first row is Print.h
In Print.h, print(char*) calls write(char*), which calls write(char*,int) using strlen to get length, which calls write(char). The last two are virtual and the last one is pure virtual.

The second and third row are WiFiClient:Client:Stream:Print
The two virtual write methods are overwritten with meaningful stuff and write(char*,int) no longer calls write(char), which makes a lot of sense. Instead, write(char) calls write(char*,int), thus putting only one byte on each packet if I call write(char) repeatedly.

I really appreciate it if some expert can tell me what these diagrams are called in CS.

I refer to this as call-stacks, as all these functions calls are stacked upon each other.

There is inheritance of base functions and implementations of virtual ones etc.

Thanks Rob. It seems from this wiki page that call stack is the actual stack of return addresses for functions to return to their callers. I agree that this diagram will make a call stack in the stack buffer. There might be a name for this static relations among the callers and functions. Until someone else comes up with a better term, I'm going to call my diagram static call stacks :slight_smile:

liudr:
Until someone else comes up with a better term, I'm going to call my diagram static call stacks :slight_smile:

It's sometimes called a static structure diagram or a call graph.

(The term call stack is usually only used to refer to the memory structure that records the hierarchy of nested function calls in progress, and that's not what this is.)

Thanks Peter!
More than I wanted (details) but I know what to look for if I need a tool to draw these diagrams:

(The term call stack is usually only used to refer to the memory structure that records the hierarchy of nested function calls in progress, and that's not what this is.)

Right, call stack is the run-time view, static structure diagram is the design-time view.

robtillaart:

(The term call stack is usually only used to refer to the memory structure that records the hierarchy of nested function calls in progress, and that's not what this is.)

Right, call stack is the run-time view, static structure diagram is the design-time view.

Thanks Rob. I think I might be able to use static structure diagram when designing my next library.

call graph.

that one. Or sometimes "backtrace" when you're using a debugger and are getting info about "how did I get here" from one of the bottom level functions.