/********************************************//** * \brief Frees data pointer created by load * * \returns Zero on success, otherwise error ***********************************************/ static inline int uvl_free_data (void *data) ///< Data allocated by @c uvl_load_file { PsvUID block; block = sceKernelFindMemBlockByAddr (data, 0); if (block < 0) { LOG ("Cannot find block id: 0x%08X", block); } if (sceKernelFreeMemBlock (block) < 0) { LOG ("Cannot free block: 0x%08X", block); return -1; } return 0; }
/********************************************//** * \brief Wrapper to allocate code memory block * * Wrapper function to allocate code memory and * return a block id. * \returns Block id for code memory ***********************************************/ int sceKernelAllocCodeMemBlock(const char *name, ///< Block name unsigned int length) ///< Allocate size { return sceKernelFindMemBlockByAddr(uvl_alloc_code_mem(&length), 0); }