[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

3536.0. "Does XCreateImage allocate the memory?" by SITBUL::MCCARTNEY () Fri Oct 26 1990 13:10

    When calls such as XCreateImage are called, does DECwindows expect the
    memory to already be allocated or does it allocate the memory itself? 
    I have a program which declares 
    
    Local	Image_struct : X$Image
    
    Then calls X$CREATE_IMAGE passing Image_struct as one of its
    parameters.  Is this correct or should I use REF X$IMAGE to keep from
    having the memory allocated twice?
    
    I thought what I had was right but when questioned I checked the Xlib
    books.  They say that the call to X$Create_Image alocates and
    initializes the image data structure minus the image memory itself. 
    Now I'm really confused.
    
    Thanks,
    
    Irene
T.RTitleUserPersonal
Name
DateLines
3536.1OXNARD::KLEEKen LeeFri Oct 26 1990 14:509
    According to the Xlib manual, "The XCreateImage function allocates the
    memory needed for an XImage structure for the specified display but
    does not allocate space for the image itself."  One of the arguments to
    XCreateImage is a pointer to the image data, which you must allocate
    and define separately.  Note, however, that XDestroyImage destroys both
    the XImage structure and the user image data.
    
    Ken
    
3536.2But does DECwindows do what the manual says?SITBUL::MCCARTNEYFri Oct 26 1990 15:077
    I know the manual says the call allocates the memory.  I also know that
    everytime we've tried to use REF X$IMAGE and count on X to do the
    allocation we get access violations.  We have no problem with the
    X$DESTROY_IMAGE call.  I'm trying to find out if what the manual is
    saying is truly what DECwindows is doing.
    
    Irene
3536.3MIT binding is different from VAX bindingOXNARD::KLEEKen LeeFri Oct 26 1990 16:056
    The DECwindows MIT binding does create the image structure (using the
    user's data).  The VAX binding expects the structure to be passed in as
    a function argument and does not create the structure.
    
    Ken