Sponsored Content
Operating Systems Linux Red Hat Memmove fail on 4 Gb+ raster under RHEL 64 bit Post 302914308 by imagtek on Sunday 24th of August 2014 02:40:44 PM
Old 08-24-2014
Memmove fail on 4 Gb+ raster under RHEL 64 bit

I'm rotating huge image rasters (1+ GB) using a 3-shear algorithm. I rotate 'in-place' after reallocating the raster. A necessary first step is reorganizing the image in the new raster dimensions that will exist after the rotation. RGBA pixels byte packed into uint32.

The following code runs fine on rasters < 4 Gb. No issues.
When I run it on rasters > 4 Gb, memmove() crashes.

I was under the impression that 64 bit Linux could take on all size data structures.

Any ideas out there. I am at my wits end on this.

Any replies greatly appreciated.

Imagtek
imagtek.com

Code:
****************************************************************

   lbuf1  = (int32u *)realloc(*outrast, (longu)(Rcols*Rrows*4));
   if( !lbuf1 )
      return( -2 );                // insufficient memory

    if( Rcols > icols ){       // fit icols,irows to new Rcols,Rrows
      fprintf(stderr, "fitting data...");
      il = lbuf1 + (longu)((irows-1) * icols);
      ol = lbuf1 + (longu)((irows-1) * Rcols);
      for(iy=1; iy<irows; ++iy){
        memmove(ol, il, (longu)(icols * 4));
        ol -= Rcols;
        il  -= icols;
      }
      fprintf(stderr, "done...");
    } 

***************************************************************

Moderator's Comments:
Mod Comment Please use code tags

Last edited by jim mcnamara; 08-24-2014 at 06:04 PM.. Reason: CODE TAGS
 

7 More Discussions You Might Find Interesting

1. Programming

copying or concatinating string from 1st bit, leaving 0th bit

Hello, If i have 2 strings str1 and str2, i would like to copy/concatenate str2 to str1, from 1st bit leaving the 0th bit. How do i do it? (2 Replies)
Discussion started by: jazz
2 Replies

2. Programming

q on memmove()

Besides syntax-related issues, is there anything else I should be aware of when using memmove() ? If misued, can it create runtime errors ? (3 Replies)
Discussion started by: JamesGoh
3 Replies

3. Shell Programming and Scripting

Learning - Why does this bit of code fail

In bash: for i in 1 2 3 4 5 do tmp_${i}=$i echo $i done It gives error on executing tmp_1=1, and so on... Why? If I executed this in prompt, not from script, it shouldn't make a subshell should it? please use "code" tags! thanks... (2 Replies)
Discussion started by: StuartH
2 Replies

4. Red Hat

Wrong ELFCLASS64 in RHEL 5 64 bit

Hi, I am using DB2 9.7 , configured odbc.ini file and exported environment variables but I am getting the following error. error while loading shared libraries: libodbc.so.1: wrong ELF class: ELFCLASS64 Kindly help. (4 Replies)
Discussion started by: roopalidalvi231
4 Replies

5. Shell Programming and Scripting

How to handle 64 bit arithmetic operation at 32 bit compiled perl interpreter?H

Hi, Here is the issue. From the program snippet I have Base: 0x1800000000, Size: 0x3FFE7FFFFFFFF which are of 40 and 56 bits. SO I used use bignum to do the math but summing them up I always failed having correct result. perl interpreter info, perl, v5.8.8 built for... (0 Replies)
Discussion started by: rrd1986
0 Replies

6. Red Hat

DNS Service not Start in RHEL 6.4 64 bit

Hi All, I am new to linux and i am configuring DNS server but while i restart service it shows below given error. Please help to solve this error. # /etc/init.d/named restart Stopping named: Generating /etc/rndc.key: ... (2 Replies)
Discussion started by: Chintanghanti
2 Replies

7. Windows & DOS: Issues & Discussions

Which version of Windows Vista to install with a product key? 32-bit or 64-bit?

Hello everyone. I bought a dell laptop (XPS M1330) online which came without a hard drive. There is a Windows Vista Ultimate OEMAct sticker with product key at the bottom case. I checked dell website (here) for this model and it says this model supports both 32 and 64-bit version of Windows... (4 Replies)
Discussion started by: milhan
4 Replies
GLBITMAP(3G)															      GLBITMAP(3G)

NAME
glBitmap - draw a bitmap C SPECIFICATION
void glBitmap( GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap ) PARAMETERS
width, height Specify the pixel width and height of the bitmap image. xorig, yorig Specify the location of the origin in the bitmap image. The origin is measured from the lower left corner of the bitmap, with right and up being the positive axes. xmove, ymove Specify the x and y offsets to be added to the current raster position after the bitmap is drawn. bitmap Specifies the address of the bitmap image. DESCRIPTION
A bitmap is a binary image. When drawn, the bitmap is positioned relative to the current raster position, and frame buffer pixels corre- sponding to 1's in the bitmap are written using the current raster color or index. Frame buffer pixels corresponding to 0's in the bitmap are not modified. glBitmap takes seven arguments. The first pair specifies the width and height of the bitmap image. The second pair specifies the location of the bitmap origin relative to the lower left corner of the bitmap image. The third pair of arguments specifies x and y offsets to be added to the current raster position after the bitmap has been drawn. The final argument is a pointer to the bitmap image itself. The bitmap image is interpreted like image data for the glDrawPixels command, with width and height corresponding to the width and height arguments of that command, and with type set to GL_BITMAP and format set to GL_COLOR_INDEX. Modes specified using glPixelStore affect the interpretation of bitmap image data; modes specified using glPixelTransfer do not. If the current raster position is invalid, glBitmap is ignored. Otherwise, the lower left corner of the bitmap image is positioned at the window coordinates xw = xr - xo yw = yr - yo where ( xr , yr ) is the raster position and ( xo , yo ) is the bitmap origin. Fragments are then generated for each pixel corresponding to a 1 (one) in the bitmap image. These fragments are generated using the current raster z coordinate, color or color index, and current raster texture coordinates. They are then treated just as if they had been generated by a point, line, or polygon, including texture map- ping, fogging, and all per-fragment operations such as alpha and depth testing. After the bitmap has been drawn, the x and y coordinates of the current raster position are offset by xmove and ymove. No change is made to the z coordinate of the current raster position, or to the current raster color, texture coordinates, or index. NOTES
To set a valid raster position outside the viewport, first set a valid raster position inside the viewport, then call glBitmap with NULL as the bitmap parameter and with xmove and ymove set to the offsets of the new raster position. This technique is useful when panning an image around the viewport. ERRORS
GL_INVALID_VALUE is generated if width or height is negative. GL_INVALID_OPERATION is generated if glBitmap is executed between the execution of glBegin and the corresponding execution of glEnd. ASSOCIATED GETS
glGet with argument GL_CURRENT_RASTER_POSITION glGet with argument GL_CURRENT_RASTER_COLOR glGet with argument GL_CURRENT_RASTER_DISTANCE glGet with argument GL_CURRENT_RASTER_INDEX glGet with argument GL_CURRENT_RASTER_TEXTURE_COORDS glGet with argument GL_CURRENT_RASTER_POSITION_VALID SEE ALSO
glDrawPixels, glPixelStore, glPixelTransfer, glRasterPos GLBITMAP(3G)
All times are GMT -4. The time now is 09:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy