Re: [Algorithms] memory pool algorithms
Brought to you by:
vexxed72
|
From: <Pau...@sc...> - 2009-04-24 08:49:32
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 > That'll work ok, but you can skip the array of allocated/free element > indices if the objects are small enough and you don't need pointers into > them; just copy the "lastAllocated" element into the "newlyFreed" slot > when freeing, and always stick onto the end of the array. Ahh yes, the old particle system trick :) > then clearly moving things around shouldn't be too terrible. I believe > keeping a parallel bitfield would be more straight forward than an > unsorted array of free elements. So with the parallel bit-field, each bit indicates whether the element has been allocated, and when you iterate over all elements you skip elements without a set bit? Cheers, Paul. ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify pos...@sc... This footnote also confirms that this email message has been checked for all known viruses. Sony Computer Entertainment Europe Limited Registered Office: 10 Great Marlborough Street, London W1F 7LP, United Kingdom Registered in England: 3277793 ********************************************************************** P Please consider the environment before printing this e-mail -----BEGIN PGP SIGNATURE----- Version: PGP Universal 2.9.1 (Build 287) Charset: US-ASCII wsBVAwUBSfF21XajGqjtoMHxAQhB/AgAqmD3jNwpjDdAx818d8KrwC3vs91b6nxw gQ7T+2wUN2xjtaG24U8Xt/s80VmZbkKd63EVhCn9cjqcT8qy3gSoMH3NvG9W15Jr qRPFGeWZDsv0WFad9Ir0OPuSNDmIc/yX5VmgqducxopuK81laD6MLC+GPZ9KYd/f nH92g25fzr3lKWgN+ML7oGcpxHOjFj92U/bS7hy16nRDOtKXIaRt00acku+zhmu3 J56YMeQFGZ6sfBF+QusSvF4R+c+UZej4MP3rzuJymY2IXRWBzO3Igy5tMLiyOXDp n+XrJm2A7+L8bJ21oGgxLEQhLsPrOIv4r6umFQDZiFUYZkekUHbSVw== =uvC5 -----END PGP SIGNATURE----- |