Sponsored Content
Top Forums Programming Boehm garbage collector for C Post 303015690 by dodona on Tuesday 10th of April 2018 08:30:16 AM
Old 04-10-2018
Boehm garbage collector for C

is anybody out there experienced with the boehm gc?

this is a very simple function:
Code:
 int fn1(){ 
    int *p = (int *) GC_MALLOC(sizeof(int *));   
    return 0; 
}

after leaving fn1() gc should free p.

***

now another example:
Code:
int* fn2(){  
    int* p= (int *) GC_MALLOC(sizeof(int *));
    return p;
 }

after leaving fn2() gc should not free p.

Code:
int main (...){
     int* n = fn1;
     *n+=2;
     fn3(n);
     ...
}

my question is: does something like that work or is there any gc related function/macro for assigning a pointer to a pointer allocated by gc?
 

We Also Found This Discussion For You

1. IP Networking

IP Netflow collector

Help, Does anybody know of any freeware Netflow collector tools to monitor IP traffic from Cisco routers and switches which run on Solaris? Thanks! (1 Reply)
Discussion started by: bubba112557
1 Replies
XmScrollVisible(3X)													       XmScrollVisible(3X)

NAME
XmScrollVisible - A ScrolledWindow function that makes an invisible descendant of a ScrolledWindow work area visible SYNOPSIS
#include <Xm/ScrolledW.h> void XmScrollVisible (scrollw_widget, widget, left_right_margin, top_bottom_margin) Widget scrollw_widget; Widget widget; Dimension left_right_margin; Dimension top_bottom_margin; DESCRIPTION
XmScrollVisible makes an obscured or partially obscured widget or gadget descendant of a ScrolledWindow work area visible. The function repositions the work area and sets the specified margins between the widget and the nearest viewport boundary. The widget's location rela- tive to the viewport determines whether one or both of the margins must be adjusted. This function requires that the XmNscrollingPolicy of the ScrolledWindow widget be set to XmAUTOMATIC. Specifies the ID of the ScrolledWindow widget whose work area window contains an obscured descendant. Specifies the ID of the widget to be made visible. Specifies the margin to establish between the left or right edge of the widget and the associated edge of the viewport. This margin is established only if the widget must be moved horizontally to make it visi- ble. Specifies the margin to establish between the top or bottom edge of the widget and the associated edge of the viewport. This margin is established only if the widget must be moved vertically to make it visible. For a complete definition of ScrolledWindow and its associated resources, see XmScrolledWindow(3X). SEE ALSO
XmScrolledWindow(3X) XmScrollVisible(3X)
All times are GMT -4. The time now is 07:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy