mirror of
https://github.com/xcat2/xNBA.git
synced 2024-12-14 15:21:32 +00:00
Add free_image
This commit is contained in:
parent
9817f93094
commit
742f242863
@ -89,6 +89,23 @@ struct image * find_image ( const char *name ) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Free loaded image
|
||||
*
|
||||
* @v image Executable/loadable image
|
||||
*
|
||||
* This releases the memory being used to store the image; it does not
|
||||
* release the @c struct @c image itself, nor does it unregister the
|
||||
* image.
|
||||
*/
|
||||
void free_image ( struct image *image ) {
|
||||
if ( image->free )
|
||||
image->free ( image->data );
|
||||
image->free = NULL;
|
||||
image->data = UNULL;
|
||||
image->len = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load executable/loadable image into memory
|
||||
*
|
||||
|
@ -109,6 +109,7 @@ extern struct list_head images;
|
||||
extern int register_image ( struct image *image );
|
||||
extern void unregister_image ( struct image *image );
|
||||
struct image * find_image ( const char *name );
|
||||
extern void free_image ( struct image *image );
|
||||
extern int image_load ( struct image *image );
|
||||
extern int image_autoload ( struct image *image );
|
||||
extern int image_exec ( struct image *image );
|
||||
|
Loading…
Reference in New Issue
Block a user