From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA20839; Fri, 28 Dec 2001 16:25:16 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA20924 for ; Fri, 28 Dec 2001 16:25:16 +0100 (MET) Received: from mel-rto7.wanadoo.fr (smtp-out-7.wanadoo.fr [193.252.19.26]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id fBSFPFT10348 for ; Fri, 28 Dec 2001 16:25:15 +0100 (MET) Received: from mahonia.wanadoo.fr (193.252.19.58) by mel-rto7.wanadoo.fr; 28 Dec 2001 16:25:15 +0100 Received: from warp (80.11.194.199) by mahonia.wanadoo.fr; 28 Dec 2001 16:25:00 +0100 Message-ID: <000b01c18fb3$8a443b90$c7c20b50@warp> From: "Warp" To: "OCaml" Subject: [Caml-list] Garbage Again Date: Fri, 28 Dec 2001 16:22:58 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk It crashed again.... First, I'm allocating memory ( I think it's the good way to do it ) : ------------ value *windata = malloc(sizeof(value)); messageid = alloc(1,MSGID_TAG); Store_field(messageid,1,Val_int(0)); handletag = alloc(1,HANDLE_TAG); Store_field(handletag,1,Val_int(0)); message = alloc(5,MESSAGE_TAG); Store_field(message,0,handletag); Store_field(message,1,messageid); Store_field(message,2,Val_int(0)); // wParam Store_field(message,3,Val_int(0)); // lParam Store_field(message,4,Val_int(0)); // MSG* *windata = alloc(4,WINDOW_TAG); register_global_root(windata); Store_field(*windata,0,Val_unit); Store_field(*windata,1,callback); Store_field(*windata,2,message); Store_field(*windata,3,Val_int(func)); // default proc --------- Then, creating the window, and linking custom data and handle HWND handle = CreateWindow( .... ) // store handle into data Store_field(*windata,0,Val_int(handle)); // store data into handle SetWindowLong(handle,GWL_USERDATA,(long)windata); -------- And my windowProc : having parameters ( hwnd, uMsg, wParam, lParam ) windata = (value*)GetWindowLong(hwnd,GWL_USERDATA); callback = Field(*windata,1); // update message fields message = Field(*windata,2); Store_field(Field(message,0),0,Val_int(hwnd)); Store_field(Field(message,1),0,Val_int(uMsg)); Store_field(message,2,Val_int(wParam)); Store_field(message,3,Val_int(lParam)); // caml callback result = Int_val(callbackN_exn(callback,1,&message)); return result; --------- I got a crash in callbackN_exn / interprete / minor_collection / empty_minor_head / oldify_local_root / .... (4 oldify calls) / *p = v minor_gc.c:122) I can see that message is being collected, but I don't know why because *windata contains it so.... I've tryed both with/without CAML* garbage macros, it doesn't work Thanks for any help / clue. Warp ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr