[eigen] portable reallocation... |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: Eigen <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: [eigen] portable reallocation...
- From: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>
- Date: Fri, 26 Feb 2010 10:36:47 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=ycskqcU4c6/oRmEBK9pVvj25ZiWI1UKH5H566hqtvKI=; b=mMUne11C2QTgauIKArcJKaEHhHCqDDqEIxtvJ7Y4kx2AXLBReumKxtPIt1xK14sx70 f9PQKkZ/kqAGc2sVLsX9MAsZ/E/9xhkr0hIhiMFEqGjUs5sAqz+XfqUFvm+13WORNsJ3 1kWlBz0IFn4dZ3mD/j2p8Jtx40LRyIUxbyaqc=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=am8mWSPY1Ac9Fy71HpHUgMT9QR3lXZMF/k9uB2z1hQFHyrIL3NYMf3vwwTTIw2gaG1 /Tk9i3RXDP8Mz9jZqsOtJ7iwCkAq3QKz6logWx9GCLVUtAInJgtdOn7IsxuKagr+3Pul h60xa0B1zxsZYun59ixs+cxh6Tic3DCpN1pj4=
Hi guys,
Since somebody asked on the forum I looked into implementing
..conservativeResize(...) based on realloc where that makes sense. Such
an implementation might yield higher performance since in some cases
the data does not need to be copied.
The issue I am running into right now is that there is no portable
version of _mm_realloc. On MSVC this is not really a problem since
_mm_malloc = _aligned_alloc and thus I can fall back to
_aligned_realloc. On other systems on the other hand side, I have no
idea how _mm_malloc is implemented. An alternative would be to provide
something as shown here
http://stackoverflow.com/questions/1641067/i-figured-out-how-to-write-realloc-but-i-know-the-code-is-not-right
Also not very nice and still no solution since the standard does not
define a function mm_getsize. On MSVC it is called _msize and on other
systems it has different names - when it exists at all.
The gist is that without knowing the size of the memory buffer I am
about to reallocate, there is no way in implementing a malloc/free
based version of realloc.
Any suggestions?
- Hauke