niye kimse help e bakmaz, niye biraz dahi araştırma yapmadan illaki aklına geleni birilerine sorma zorunluluğu duyar. heleki bizde buna mecburmuşuz gibi sitem, laf ederler.
Sizeof() parametre ne gönderirsen onun boyutunu verir, değişken tipini verirsen o tipin boyutuu verir, delphi içinde Sizeof yazıp üzerinde "F1" e basıp en tepel PASCAL function bilgilerini ulaşın
getmem ile açtığını freemem le vermen gerek, bu eski pascal komutları, heap memory kullanabilmek için gerekirlerdi, DOS zamanında 640kb üstüne erişebilmek için
new ile aldığını dispose ile vermen gerek. buda heapmem içindi
fark: get-free mem de boyut belirlenir. new-dispose da boyut parametre gönderilen değişkenin kullandığı kadardır,derleyici belirler denebilir.
pointer ->
http://translate.google.com/#auto/tr/pointer
memory yi havuza benzertin, değişkeninizde bir kap, buna isim verdiniz FData, data yada amet memet, bu kapın tutabilmeniz için bir SAPı olmalı, o sapın ingilizce adı "pointer"
pointer da bir integer değişkendir. ctrl + left clik le değişkeni takip ederseniz nereye gittiğini takip ederseniz, daha çokta ÖĞRENME iç güdüsünü tetikleyen MERAK olunca, insan öğrenir.
Alıntılar aşağıdadır,
yüce google a soru "delphi getmem" çıkan ilk cevap "
http://www.delphibasics.co.uk/RTL.asp?Name=GetMem"
yüce google a soru "delphi new" çıkan ilk cevap "
www.delphibasics.co.uk/RTL.asp?Name=New"
Delphi XE2 editör ünherhangi bir yerine sadece getmem yazıp üzerine F1 e basılınca çıkan sonuçlar 4 adet (topic-> konu) bunlardan "System.GetMem" aşağıdadır
System.Getmem
Description
GetMem allocates a memory block.
GetMem allocates a block of the given Size on the heap, and returns the address of this memory in the P parameter. The bytes of the allocated buffer are not set to zero. To dispose of the buffer, use FreeMem. If there is not enough memory available to allocate the block, an EOutOfMemory exception is raised.
Note: If the memory block must be initialized with zero, you can use AllocMem.
This function is not available in C++. In C++ you can use GetMemory.
In case of a typed pointer, you should consider the New and Dispose procedures, which respectively initialize and finalize the memory block accordingly.
Buda New için HELP-> Yardım
System.New
Description
Creates a new dynamic variable and sets P to point to it.
In Delphi code, the New procedure creates a new dynamic variable and sets a pointer variable to point to it. P is a variable of any pointer type. The size of the allocated memory block corresponds to the size of the type that P points to. The newly created variable can be referenced as P^. If there is not enough memory available to allocate the dynamic variable, an EOutOfMemory exception is raised.
When an application is finished using a dynamic variable created with New, it should dispose of the memory allocated for the variable using the Dispose standard procedure.
See Also
Aşağıda Delphi 2007 help inden alıntıdır
File
System
Description
GetMem allocates a block of the given Size on the heap, and returns the address of this memory in parameter P. The bytes of the allocated buffer are not set to zero. To dispose of the buffer, use FreeMem. If there isn't enough memory available to allocate the block, an EOutOfMemory exception is raised.
Note: If the memory needs to be zero-initialized, use AllocMem instead.
Delphi Examples:
Aşağıdaki alıntı Lazarus Help inden alıntıdır
Description
Getmem reserves Size bytes memory on the heap, and returns a pointer to this memory in p. What happens if no more memory is
available, depends on the value of the variable ReturnNilIfGrowHeapfails: if the variable is True then Nil is returned. If the variable is False, a
run-time error is generated. The default value is False, so by default an error is generated.
The newly allocated memory is not initialized in any way, and may contain garbage data. It must be cleared with a call to FillChar or FillWord.
For an example, see Freemem.