INNER CODE UNIT · C++

magic_ptr

TheAssemblyArmada/Vanilla-Conquer · common/alloc.cpp:116

    magic_ptr = (uintptr_t*)(((char*)mem_ptr) + bytes_to_alloc - sizeof(uintptr_t) * 8);
    *magic_ptr++ = (uintptr_t)mem_ptr;
    *magic_ptr++ = (uintptr_t)mem_ptr;
    *magic_ptr++ = (uintptr_t)mem_ptr;
    *magic_ptr = (uintptr_t)mem_ptr;
#endif // MEM_CHECK

    Memory_Calls++;
    return (mem_ptr);
}

/***************************************************************************
 * Free -- Free an Alloc'ed block of RAM.                                  *
 *                                                                         *
 * FUNCTION:                                                               *
 *                                                                         *
 * INPUT:       A pointer to a block of RAM from Alloc.                    *
 *                                                                         *

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…