- Joined
- Jul 10, 2007
- Messages
- 6,306
local TimerPointer tp = TimerPointer.create()
local timer t = tp.timer
Yours is RAM heavy and you don't create more in the chance of overflow. It also doesn't have Hash table support as a fallback in case the handle table flips back around to a Lower number during creation of those timers. Just letting you know the caveats.
local timer tim = CreateTimer()
local integer i = GetHandleId(tim)
call DestroyTimer(tim)
set tim = null
call BJDebugMsg(I2S(GetHandleId(CreateTimer())) +" =! " +I2S(i))
The handles are not recycled instantly, but if memory serves somewhere around every 1024 handles or 8192 handles, if some of those handles were destroyed along the way it will wrap around back to handle 0x100000 and start the count up until it encounters a handle that is still in use. Don't quote those numbers, but one can BJDebugMsg the handle Id every 500 handles in a loop that basically creates and destroys timer handles as a test. I'll do this test again later today and come back with some more accurate numbers.
The handles are not recycled instantly, but if memory serves somewhere around every 1024 handles or 8192 handles, if some of those handles were destroyed along the way it will wrap around back to handle 0x100000 and start the count up until it encounters a handle that is still in use. Don't quote those numbers, but one can BJDebugMsg the handle Id every 500 handles in a loop that basically creates and destroys timer handles as a test. I'll do this test again later today and come back with some more accurate numbers.
Most people with that much RAM will not be playing WarCraft 3 but higher-demanding titles with eye candy.
People who play WC3 are more likely to have an old machine or a cheapo computer and WC3 is the best quality game they can run.
Don't make the RAM argument when a standard computer usually comes with a bare minimum of 8 gigs of RAM nowadays. Actually, it's 16 gigs now.
Don't make the RAM argument when a standard computer usually comes with a bare minimum of 8 gigs of RAM nowadays. Actually, it's 16 gigs now.
It's just very frustrating when I have to argue about ridiculous stuff.
I really don't like the preloading nature of this, and as others have pointed out it can be intensive on slower machines (huge percentage of war3 community). Since it's called at initialization, it will increase the maps load time which was one thing I hated when I had a slower pc. I understand that aspect alone shouldn't discredit a resource, but I do feel in this one it does. There are already many more useful, standardized timer systems out there. I also really dislike your idea of splitting aspects of a timer system up into multiple modules/structs. It just creates more useless dependencies.
I really think the community has all it needs in regards to attaching data to timers.