Re: [eigen] Checking for integer overflow in size computations |

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] Checking for integer overflow in size computations*From*: Christoph Hertzberg <chtz@xxxxxxxxxxxxxxxxxxxxxxxx>*Date*: Mon, 17 Oct 2011 11:14:57 +0200

On 17.10.2011 00:36, Benoit Jacob wrote:

2011/10/16 Christoph Hertzberg<chtz@xxxxxxxxxxxxxxxxxxxxxxxx>:On 16.10.2011 22:21, Benoit Jacob wrote:Note that there is a small performance overhead associated with that. I tried to minimize it, but there is still 1 integer division in the size=rows*cols overflow check. I hope that's still negligible compared to the cost of malloc.I have not looked into your patch yet, but wouldn't a multiplication in int64/int128 also do the job?I don't know that all platforms have an integer type twice bigger than size_t? On x86-64 are there 128 bit integers? I didn't know that. Also I'm afraid there might exist 32bit platforms without 64bit integers.

http://stackoverflow.com/questions/1541426/computing-high-64-bits-of-a-64x64-int-product-in-c

Christoph -- ---------------------------------------------- Dipl.-Inf. Christoph Hertzberg Cartesium 0.051 Universität Bremen Enrique-Schmidt-Straße 5 28359 Bremen Tel: (+49) 421-218-64252 ----------------------------------------------

**References**:**[eigen] Checking for integer overflow in size computations***From:*Benoit Jacob

**Re: [eigen] Checking for integer overflow in size computations***From:*Christoph Hertzberg

**Re: [eigen] Checking for integer overflow in size computations***From:*Benoit Jacob

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] Checking for integer overflow in size computations** - Next by Date:
**Re: [eigen] Checking for integer overflow in size computations** - Previous by thread:
**Re: [eigen] Checking for integer overflow in size computations** - Next by thread:
**[eigen] How are you...**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |