Re: memory pool algorithms

[email protected]
Newsgroups gmane.games.devel.algorithms
Message-ID <OF74468963.E9299691-ON802575A2.002E2E88-802575A2.002E0C1B@scee.net>
-----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 [email protected]
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-----

------------------------------------------------------------------------------
Crystal Reports &#45; New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty&#45;free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
GDAlgorithms-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.