Sponsored Content
Top Forums Programming how to round up a memory address(memory alignment problem) Post 84082 by nj302 on Wednesday 21st of September 2005 04:29:46 PM
Old 09-21-2005
Still I got same bus error. The problem is that the dev is not at the address where keybuff + s_docname is

Some processors are not able to load an integer, unsigned etc, from an address which is not a multiple of the size of that integer. For 4-byte integers, the address it is loaded from, looking at the lowest two bit only, must be 00. It is called 4-byte alignment.

I need to "round up" my s_docname by some suitable calculation, leaving what is called 'padding' between docname and dev.

I need some advice on how to round this up. Thanks a lot.
 

10 More Discussions You Might Find Interesting

1. Solaris

Memory Alignment Problem on Sun Sparcs

Hi, I try to marshal a unsigned int and a char * into a buffer, and then unmarshal them later to get them out. I need to put the char * in the front and unsigned int at the end of the buffer. However, my system always give me "BUS ERROR". I am using Sun Sparcs Sloris 2.10. My code to marshal the... (1 Reply)
Discussion started by: nj302
1 Replies

2. Programming

Cannot access memory at address 0x8

Hi All I have a structure pointer and setting that pointer as NULL. When i tried to access the elements in the structure i am getting the error message. "Cannot access memory at address 0x8". This i tried in LINUX. When the same program is tried thro UNIX (HP-UX), i am not getting the message... (8 Replies)
Discussion started by: rkraj
8 Replies

3. Solaris

Error: Memory Address Not aligned

Hi, The following error message occured when I was trying to reboot my SUN machine: Memory address not aligned Its a Sun 280 R , Ultra SPARC III What should I do. Varma (3 Replies)
Discussion started by: gunnervarma
3 Replies

4. Solaris

How to find Total and Free Physical Memory and Logical Memory in SOLARIS 9

Hi, Im working on Solaris 9 on SPARC-32 bit running on an Ultra-80, and I have to find out the following:- 1. Total Physical Memory in the system(total RAM). 2. Available Physical Memory(i.e. RAM Usage) 3. Total (Logical) Memory in the system 4. Available (Logical) Memory. I know... (4 Replies)
Discussion started by: 0ktalmagik
4 Replies

5. Solaris

restrcit physical memory with zone.max-locked-memory

Is it possible to restrict physical memory in solaris zone with zone.max-locked-memory just like we can do with rcapd ? I do not want to used rcapd (1 Reply)
Discussion started by: fugitive
1 Replies

6. UNIX for Dummies Questions & Answers

change the memory address of ld.linux-so in a dynamically linked process

hi, For some special reason , I'd like to control the memory address for the shared libraries in my dynamically linked process. And it is the "ld" which interpret the dynamically linked library, and in my system, the "ld-linux.so.2" is put at 0x00812000. Then I use "prelink -r" command to change... (0 Replies)
Discussion started by: zerocool_08
0 Replies

7. Linux

change the memory address of ld.linux-so in a dynamically linked process

hi, For some special reason , I'd like to control the memory address for the shared libraries in my dynamically linked process. And it is the "ld" which interpret the dynamically linked library, and in my system, the "ld-linux.so.2" is put at 0x00812000. Then I use "prelink -r" command to... (3 Replies)
Discussion started by: zerocool_08
3 Replies

8. UNIX for Advanced & Expert Users

What is the function to get address of the virtual memory block in linux??

I want address of current virtual memory block? i am using fedora10:wall::wall: (1 Reply)
Discussion started by: powyama
1 Replies

9. Solaris

[DOUBT] Memory high in idle process on Solaris 10 (Memory Utilization > 90%)

Hi Experts, Our servers running Solaris 10 with SAP Application. The memory utilization always >90%, but the process on SAP is too less even nothing. Why memory utilization on solaris always looks high? I have statement about memory on solaris, is this true: Memory in solaris is used for... (4 Replies)
Discussion started by: edydsuranta
4 Replies

10. UNIX for Beginners Questions & Answers

How to write a value to a physical memory address in bash script?

How would I write a value to a physical memory address? I was able to read a physical memory address (for example, 0x400) using this line: dd if=/dev/mem count=4 bs=1 skip=$(( 0x400 )) But I get an error: dd: 'standard input': cannot skip to specified offset when I try to write using... (1 Reply)
Discussion started by: rabrandt
1 Replies
SDL_SETROWSTRETCHCOD(3) 					   Manual Pages 					   SDL_SETROWSTRETCHCOD(3)

NAME
SDL_SetRowStretchCode, SDL_PutRowStretchCode, SDL_RunRowStretchCode, SDL_StretchRow1, SDL_StretchRow2, SDL_StretchRow3, SDL_StretchRow4 - (src/SDL_stretchcode.h) SYNOPSIS
#include <SDL_stretch.h> unsigned char* SDL_SetRowStretchCode(int src_w, int dst_w, int bpp); unsigned char* SDL_PutRowStretchCode(unsigned char* buffer, int buflen, int src_w, int dst_w, int bpp); void SDL_RunRowStretchCode(unsigned char* buffer, unsigned char* src, unsigned char* dst); void SDL_StretchRow1(Uint8 *src, int src_w, Uint8 *dst, int dst_w); void SDL_StretchRow2(Uint16 *src, int src_w, Uint16 *dst, int dst_w); void SDL_StretchRow3(Uint8 *src, int src_w, Uint8 *dst, int dst_w); void SDL_StretchRow4(Uint32 *src, int src_w, Uint32 *dst, int dst_w); DESCRIPTION
The SetRowStretchCode is a wrapper around PutRowStretchCode that uses the Adress and Size of the shared SDL_TheRowStretchCode buffer. The PutRowStretchCode will fill the given buffer with an assembler stream that should be called with SDL_RunRowStretchCode. The assembler stream is usually faster as all the scale decisions are done in advance of the execution. This helps when a RunCode is done multiple times with the same src_w/dst_w/bpp pair. All the pixel-get and pixel-set calls are unrolled in that buffer. Therefore, the buffer should be big enough - as a rule of thumb use a buffer of size (src_w+dst_w)*5 If PutCode or SetCode fails, a NULL is returned and SDL_SetError. Otherwise, the start adress of the machine code buffer is returned, which is also the input argument of PutCode and RunCode. If SDL_SetRowStretchCode fails, the SDL_StretchRow1 function must be used instead. The SDL_StretchRow1 function and its cousins are singular routines that work in a tight loop to scale a single row. The number specifies the byte-width of each pixel (it is not a bit-width!). SDL_stretch 0.3.1 SDL_SETROWSTRETCHCOD(3)
All times are GMT -4. The time now is 09:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy