From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 4A77A7F02D for ; Tue, 7 Oct 2014 10:05:17 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of damien.pous@gmail.com) identity=pra; client-ip=209.85.214.176; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="damien.pous@gmail.com"; x-sender="damien.pous@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of damien.pous@gmail.com designates 209.85.214.176 as permitted sender) identity=mailfrom; client-ip=209.85.214.176; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="damien.pous@gmail.com"; x-sender="damien.pous@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ob0-f176.google.com) identity=helo; client-ip=209.85.214.176; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="damien.pous@gmail.com"; x-sender="postmaster@mail-ob0-f176.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnQCAEaeM1TRVdawm2dsb2JhbABfhC4LBIJ+0SsDgQkIFgERAQEBAQEGCwsJFCyEHBEdARInAw0FEA8CJgIkEgEFARYMGxqICAMRnQ6DHW6LMIUCiEonDYcdAQUOgR6SF4FUBZ0+lA4YKYFsgyo7L4JKAQEB X-IPAS-Result: AnQCAEaeM1TRVdawm2dsb2JhbABfhC4LBIJ+0SsDgQkIFgERAQEBAQEGCwsJFCyEHBEdARInAw0FEA8CJgIkEgEFARYMGxqICAMRnQ6DHW6LMIUCiEonDYcdAQUOgR6SF4FUBZ0+lA4YKYFsgyo7L4JKAQEB X-IronPort-AV: E=Sophos;i="5.04,668,1406584800"; d="scan'208";a="82229912" Received: from mail-ob0-f176.google.com ([209.85.214.176]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 07 Oct 2014 10:05:16 +0200 Received: by mail-ob0-f176.google.com with SMTP id m8so5180407obr.35 for ; Tue, 07 Oct 2014 01:05:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=M9STbvSjLXhSlcxOMYx51f8QIhCh/UTIlfcadqCojzA=; b=mxxviSlQNN70+a42D9gpEF4/RhPpN8MIrGZC5Z7Qonn1vDXG0A5/K/c9GM0VJ/tt8E qZvwW4E0iVu2aHVf9XkxujWAKq9HOKVcwJlXR586b4W+L793LANUZAoLvbQosK2x/QuW djtrY4q86+inVBOjl5+63+V82TucZ13i+Ag/sILLFXZYiUWixJLcWrsjVIkBKnYjXj+N tOlMDSt33SHIe+H2KpZgOyTp+GnTOc3h1+PBCrYV2xlEnK6CnqUOFgDnIwbo8Xg/vzlj 11K6sLHGfag+Nq1qXuNIInAZ3+RhMv5/Zcvk3cj8q3V1lSF13t+KFbKfzHwvRhrArsw1 ynLw== MIME-Version: 1.0 X-Received: by 10.182.28.100 with SMTP id a4mr2066593obh.24.1412669115156; Tue, 07 Oct 2014 01:05:15 -0700 (PDT) Sender: damien.pous@gmail.com Received: by 10.202.211.149 with HTTP; Tue, 7 Oct 2014 01:05:15 -0700 (PDT) Date: Tue, 7 Oct 2014 10:05:15 +0200 X-Google-Sender-Auth: hNcCSeMgeBG00x2G9iKgQkP2_L4 Message-ID: From: Damien Pous To: caml-list Content-Type: text/plain; charset=UTF-8 X-Validation-by: damien.pous@inria.fr Subject: [Caml-list] hook before gc major collections Hello, Is there a way to register a function, to be called before each gc major collection ? (I have some cache tables which I'd like to empty from time to time - I'm not sure this is a good idea, but I would like to experiment it.) I see two related functions in the std lib, but not the precise thing I want: - Gc.create_alarm, to register a function to be called *after* such collections ; - Gc.finalise, which I could use with a dummy heap allocated value, but then I guess my function would be called before any gc *minor* collection, which is certainly too often in my concrete use-case. Thanks in advance, Damien