Quantcast
Channel: C++ allocating memory using array - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Answer by Ben Voigt for C++ allocating memory using array

$
0
0

Instead of a pointer, use an index into the array. (Actually, a pointer is nothing but an index into the byte array representing all virtual memory). You'll have to keep track of which indexes (or ranges of indexes) are used.

This is called a pool-based allocator.


Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>