diff options
author | Jorge Arellano Cid <jcid@dillo.org> | 2014-06-24 08:20:18 -0400 |
---|---|---|
committer | Jorge Arellano Cid <jcid@dillo.org> | 2014-06-24 08:20:18 -0400 |
commit | d4b1ef469fa0362035e55365923916a40998dc84 (patch) | |
tree | 25ad4291f6ac5fe1a0fc9a2f0f6dec962004b19b /src/dicache.h | |
parent | 855bdb7290c4d82af4831596d39b73efe2a0f6dc (diff) |
Reimplemented the Dicache using dlib ADTs
For a long time it had a custom ADT with a list of nodes and each
node a linked list (with pointers). The last memory bug motivated me to
try to normalize it to use dlib. Now, it got simpler, shorter, and
possibly faster (although conversion wasn't a simple task).
PD: It also uses less memory now.
Diffstat (limited to 'src/dicache.h')
-rw-r--r-- | src/dicache.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/dicache.h b/src/dicache.h index 0390d214..7d5ef6ee 100644 --- a/src/dicache.h +++ b/src/dicache.h @@ -12,6 +12,9 @@ extern "C" { /* Symbolic name to request the last version of an image */ #define DIC_Last -1 +/* Flags: Last version, Valid entry */ +#define DIF_Last 1 +#define DIF_Valid 2 /* These will reflect the entry's "state" */ @@ -28,7 +31,8 @@ typedef struct DICacheEntry { DilloUrl *url; /* Image URL for this entry */ DilloImgType type; /* Image type */ uint_t width, height; /* As taken from image data */ - int SurvCleanup; /* Cleanup-pass survival for unused images */ + short Flags; /* See Flags */ + short SurvCleanup; /* Cleanup-pass survival for unused images */ uchar_t *cmap; /* Color map */ void *v_imgbuf; /* Void pointer to an Imgbuf object */ uint_t TotalSize; /* Amount of memory the image takes up */ @@ -42,8 +46,6 @@ typedef struct DICacheEntry { uint_t DecodedSize; /* Size of already decoded data */ CA_Callback_t Decoder; /* Client function */ void *DecoderData; /* Client function data */ - - struct DICacheEntry *next; /* Link to the next "newer" version */ } DICacheEntry; |