Re: [fpc-pascal] memory aligning

2007-11-05 Thread David Pethes
Hi, Micha Nelissen wrote: function evk_malloc (size: longword): pointer; const ALIGNMENT = 16; var ptr: pointer; begin ptr := getmem(size + ALIGNMENT); result := Align (ptr, ALIGNMENT); if result = ptr then pbyte(result) += 16; Why not use ALIGNMENT here also? Hah, I got stu

[fpc-pascal] memory aligning

2007-11-05 Thread David Pethes
Hi, I'm writing a video codec. I need some of my memory aligned to 16-byte boundaries, since I'm using SSE2 instructions in asm code, that assume this alignment. I was using a custom getmem, that called classic getmem to get some memory block, then cast the pointer and adjust it to next aligne

Re: [fpc-pascal] type Ta = 1..10; var a : Ta; // a not initialized = crash

2007-09-21 Thread David Pethes
Skybuck Flying wrote: The following program compiled with free pascal 1.0.8 crashes: The current version of freepascal is 2.2.0, please update. It won't crash any more. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepas

Re: [fpc-pascal] Funny things about utf-8 strings on mac

2007-06-12 Thread David Pethes
Felipe Monteiro de Carvalho wrote: Does anyone know what are those funny characters? (I suppose some kind of encoding setting) Your Text editor saved those files with byte order mark (BOM) - see http://en.wikipedia.org/wiki/Byte_Order_Mark. Dunno about the second part of your question though,

Re: [fpc-pascal] initialization and finalization of units?

2007-06-02 Thread David Pethes
Hi, Francisco Reyes wrote: Looking at units in ref.pdf I see an initialization and a finalization section. How are those used? the code in initialization part will be executed right after you run your program, before the main begin..end, and the code in finalization section will be execute

[fpc-pascal] scope of defining $mode

2007-06-02 Thread David Pethes
Hi, I wanted to ask about $mode global directive scope. According to http://www.freepascal.org/docs-html/prog/progse3.html#x73-710001.2, "Global directives affect the whole of the compilation process". Yet, when I have two units like this: //prog.pas {$mode delphi} program prog; uses uni; fu