void Memory::print()
{
	int totalSize = 0;
	for(int i = 0; i < kAllocTypeMax; i++) totalSize += allocSize_[i];
	kuto_printf("total   : %8d bytes¥n", totalSize);

	kuto_printf("  alloc : %8d bytes / %6d counts¥n", allocSize_[kAllocTypeAlloc], allocCount_[kAllocTypeAlloc]);
	kuto_printf("  new   : %8d bytes / %6d counts¥n", allocSize_[kAllocTypeNew], allocCount_[kAllocTypeNew]);
	kuto_printf("  new[] : %8d bytes / %6d counts¥n", allocSize_[kAllocTypeNewArray], allocCount_[kAllocTypeNewArray]);

	#ifdef USE_DL_PREFIX
		dlmalloc_stats();
	#endif

	smallAllocator_.print();
}
Example #2
0
/***************** Plugin Entry Point *****************/
enum plugin_status plugin_start(const void* parameter)
{
    const char* filename;
    int status;

    PLUGINLIB_EXIT_INIT

    if (parameter == NULL)
    {
        rb->splash(HZ, "Play a .lua file!");
        return PLUGIN_ERROR;
    }
    else
    {
        filename = (char*) parameter;

        lua_State *L = luaL_newstate();

        rocklua_openlibs(L);
        status = luaL_loadfile(L, filename);
        if (!status) {
            rb->lcd_clear_display();
            status = docall(L);
        }

        dlmalloc_stats();

        if (status) {
            DEBUGF("%s\n", lua_tostring(L, -1));
            rb->splashf(5 * HZ, "%s", lua_tostring(L, -1));
            lua_pop(L, 1);
        }

        lua_close(L);
    }

    return PLUGIN_OK;
}