8 ms·
All C programs do the same thing: look at a character and do nothing with it. —Peter Weinberger [0] Humorous 'memory' explaination of various levels of 'memory
by sargstuff 3y ago
All C programs do the same thing: look at a character and do nothing with it.
—Peter Weinberger [0]
Humorous 'memory' explaination of various levels of 'memory'[1]
Without reviewing the video, looks like a coding artifact related to segment 64k memory of 8/16/32/64 bit dos/MS windows (vs. arm / sparc with flat address space).
far/near pointer delclaration would clarify things a bit.
This is a c language artifact. Using in C++, one would need to impliment/override the default C++ supplied memory management to avoid memory management gotchas.
The code example was a way to make sure that pointer variable on a non-unified memory architecture was initialized to point within a given memory segment.
aka Reference zero's out the non-unique bits and leaves the "memory reference bits for given memory segment" alone / segmented NULL.
Zeroing out the non-unique memory bits still allows one to make use of the upper address bits to find out where in memory the given
memory segment is (useful for implimentation of setjump(), figuring out machine byte order, 1st time in segment, etc.).
[0] : Expert C Programming, Deep C Secrets by Peter Weinberger
[1] : http://www.gnu.org/fun/jokes/paging.game.html http://www.gnu.org/fun/jokes/paging.game.html