PreviousUpNext

15.4.1127  src/lib/std/src/nj/heapcleaner-control.pkg

## heapcleaner-control.pkg

# Compiled by:
#     src/lib/std/src/standard-core.sublib

# Garbage collector control and stats.

stipulate
    package ci  =  mythryl_callable_c_library_interface;                                        # mythryl_callable_c_library_interface  is from   src/lib/std/src/unsafe/mythryl-callable-c-library-interface.pkg
herein

    package   heapcleaner_control
    : (weak)  Heapcleaner_Control                                                               # Heapcleaner_Control                   is from   src/lib/std/src/nj/heapcleaner-control.api
    {
        fun cfun name
            = 
            ci::find_c_function
              {
                lib_name => "heap",
                fun_name => name
              };
            #
            ###############################################################
            # The function(s) in this package are not true syscalls.
            # The ones that invoke the heapcleaner will stop all hostthreads
            # dead anyhow, and the remainder will be too fast to matter,
            # so the usual latency-minimizing reasons to not apply here.
            # Consequently I'm not taking the time and effort to switch it
            # over from using find_c_function() to using find_c_function'().
            #                              -- 2012-04-21 CrT


        cleaner_control
            =
            cfun  "cleaner_control"
            :
            List((String, Ref(Int))) -> Void;                                                   # "cleaner_control"                     def in    src/c/lib/heap/libmythryl-heap.c

        fun clean_heap n
            =
            cleaner_control [("DoGC", REF n)];

        fun messages TRUE  => cleaner_control [("Messages", REF 1)];
            messages FALSE => cleaner_control [("Messages", REF 0)];
        end;


    };
end;



## COPYRIGHT (c) 1997 AT&T Labs Research.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext