Ignore:
Timestamp:
01/05/08 20:17:50 (12 years ago)
Author:
felix winkelmann
Message:

merged trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chicken/branches/release/manual/C interface

    r5945 r7276  
    283283
    284284
     285=== C_pre_gc_hook
     286
     287 [C Variable] void (*C_pre_gc_hook)(int mode)
     288
     289If not {{NULL}}, the function pointed to by this variable will be
     290called before each garbage collection with a flag indicating what kind
     291of collection was performed (either {{0}} for a minor collection or
     292{{2}} for a resizing collection). A "resizing" collection means a
     293secondary collection that moves all live data into a enlarged (or
     294shrinked) heap-space. Minor collections happen very frequently, so the
     295hook function should not consume too much time. The hook function may
     296not invoke Scheme callbacks.
     297
     298Note that resizing collections may be nested in normal major collections.
     299
    285300=== C_post_gc_hook
    286301
    287  [C Variable] void (*C_post_gc_hook)(int mode)
    288 
    289 If not {{NULL}}, the function pointed to by this variable will be called
    290 after each garbage collection with a flag indicating what kind of collection
    291 was performed (either {{0}} for a minor collection or {{1}} for a major
    292 collection). Minor collections happen very frequently, so the hook function
    293 should not consume too much time. The hook function may not invoke Scheme
    294 callbacks.
    295 
    296 
    297 
    298 An example:
     302 [C Variable] void (*C_post_gc_hook)(int mode, long ms)
     303
     304If not {{NULL}}, the function pointed to by this variable will be
     305called after each garbage collection with a flag indicating what kind
     306of collection was performed (either {{0}} for a minor collection,
     307{{1}} for a major collection or {{2}} for a resizing
     308collection). Minor collections happen very frequently, so the hook
     309function should not consume too much time. The hook function may not
     310invoke Scheme callbacks. The {{ms}} argument records the number of
     311milliseconds required for the garbage collection, if the collection
     312was a major one. For minor collections the value of the {{ms}} argument
     313is undefined.
     314
     315
     316
     317=== An example for simple calls to foreign code involving callbacks
    299318
    300319 % cat foo.scm
     
    335354
    336355
    337 '''Notes:'''
     356=== Notes:
    338357
    339358Scheme procedures can call C functions, and C functions can call
Note: See TracChangeset for help on using the changeset viewer.