jasper-software / jasper

Official Repository for the JasPer Image Coding Toolkit
http://www.ece.uvic.ca/~mdadams/jasper
Other
217 stars 103 forks source link

jas_get_total_mem_size returns 32bit value #363

Closed assembler65 closed 8 months ago

assembler65 commented 8 months ago

When compiling for a 32bit windows jas_get_total_mem_size returns a size_t. Inside the function it is defined as ULONGLONG. On systems with good amount of memory this will return 0 as a 32bit value is to small to return the 64bit content. This in turn causes: WARNING: JasPer memory limit set to EXCESSIVELY LARGE value (i.e., limit exceeds system memory size (1073741824 > 0)

during init.

mdadams commented 8 months ago

The C standard requires that size_t be at least as big as a pointer. so, if you have a 64-bit machine (which would need to have 64-bit pointers), then size_t would have to be 64 bits; otherwise the compiler would not be compliant with the standard. Can you please clarify the exact situation causing the overflow?