ex_loadtem() { #if TEMFLAG char filename[13],pathname[80]; long load_file(); /* overwrite changed template? */ if (change_flag[temCHANGE]) if (form_alert(1,CHNGETEM)==2) return; filename[0]=0; Dsetdrv(tem_drive); dsetpath(tem_path); tempmem= -1; if (getfile(pathname,filename,TE_EXT,TLDETITL)>0) { tem_drive=Dgetdrv(); Dgetpath(tem_path,tem_drive+1); if (load_file(pathname,filename)) { if (load_tem(filename)) { strcpy(temfile,filename); } } /* end if file loaded successfully */ } /* end if ok from file selector */ dealloc_mem(tempmem); #endif } /* end ex_loadtem() */
ex_copyfile() { #if DISKFLAG char filename[13],pathname[80]; long filestart,fileleng; int saveMP; if (midiplexer) saveMP=MPoff(); tempmem= -1; filename[0]=0; /* uses drive and path from most recent disk function */ if (getfile(pathname,filename,ALL_EXT,COPYFRMMSG)>0) { if (load_file(pathname,filename)) { if (getfile(pathname,filename,ALL_EXT,COPYTOMSG)>0) { filestart= heap[tempmem].start; fileleng= heap[tempmem].nbytes; save_file(filename,pathname,1,&filestart,&fileleng); } } } if (tempmem>=0) dealloc_mem(tempmem); graf_mouse(ARROWMOUSE); if (midiplexer&&saveMP) MPon(); #endif } /* end ex_copyfile() */
void Allocator::rollbackTransaction() { // if a transaction is active if (transaction_active) { // deallocate all allocated memory within this transaction for (size_t temp_idx = 0; temp_idx < transaction_alloc_index; ++temp_idx) { dealloc_mem(transaction_alloc_content[temp_idx]); } } transaction_active = false; }
ex_multi() { #if MULTIFLAG int exit_obj; static int fixed; /* start with blank multi-block file name (every time) */ mlxfile[0]= mlxpath[0]= 0; /* set up drives and paths (first time only) */ if (!fixed) { data_drive= mlt_drive; strcpy(data_path,mlt_path); fixed=1; } do { data_mem= mlx_mem= tempmem= -1; switch (exit_obj=mlx_dial()) { case MULTADD : mlx_add(); break; case MULTEXTR: mlx_extract(); break; case MULTDEL : mlx_delete(); break; case MULTREPL: mlx_replace(); break; case MULTNAME: mlx_name(); } /* end switch */ /* buffers could be left over from the mlx_ function */ dealloc_mem(data_mem); dealloc_mem(mlx_mem); dealloc_mem(tempmem); } while (exit_obj!=MULTEXIT); #endif } /* end ex_multi() */
/************************************************************************* * FINISH THE WORK OF THE CHECKER * * - Give all temporarily allocated memory back. * - Perform all needed tidy-up operations * * Parameter : - nothing - * Return : - nothing - * *************************************************************************/ void finish_checker ( void ) { /* Deallocate memory, used for */ /* bit map reference array */ if ( bit_maps_allocated ) { #if DEBUG IOdebug (" finish_checker : De-allocate reference bit-map areas."); #endif free_ref_maps (); /* Give the memory back ! */ } #if DEBUG IOdebug (" finish_checker : Free hash table structures"); #endif /* Give memory used by the hash-*/ remove_de_hash (); /* tables back */ remove_dup_hash (); remove_lost_hash (); remove_link_hash (); dealloc_mem (); }