It is impossible for Gamestudio to allocate this much memory because Gamestudio is a 32 Bit application. On Windows a 32 Bit application can allocate just about 1.5 GB. This means that Acknex's limit is also at about 1.5 GB.

sys_malloc will return NULL if it can't allocate the memory. Your mega_nodes pointer is a NULL-pointer. Using it as usual will crash your game. Check every time before using a pointer which can be a NULL-pointer if it is pointing to NULL. When it's not, then you can use it, but not before checking.

The nexus is memory for your level. When you create a level in WED and load it via level_load, then your level needs memory for textures and blocks and so on. Gamestudio allocates a memory area on the heap and calls this area nexus. This speeds up playing the level because everything needed is already stored inside the nexus when you start your level. After that loading is done Gamestudio doesn't need to load more data from your hard drive which saves time and lowers the risk of running out of memory while playing. If you don't work with level_load you will have nothing to do with the nexus.

When you access an array the last slot is at the position 'arraysize - 1' because the first slot is at position 0. The second slot is at position 1, the third slot is at position 2, ... and the last slot is at the position which equals 'arraysize - 1'. If you try to access a slot at a later position you will produce an error because you're outside the bounds of the array.