18 Aoû
2013
18 Aoû
'13
19:56
On 17.08.2013 22:59, Mikael wrote:
On struct it would make sense, it was indeed only pointered types I had on my mind. Allocate a billion, see for yourself and tell here?
I've checked this with the following example. (define (alloc-string n) (let loop ((i 0)) (if (< i n) (let ((a (std::string "test"))) (loop (+ i 1))) (write "FIN"))))) When using (struct std::string ...) without a release function, memory grow's rapidly (checked this in htop) until it heap overflows. With a given release function memory assumptions is constantly small. Seems there is currently no difference in the deallocation behaviour between structs and pointer types. Too bad :/ Chris