summaryrefslogtreecommitdiff
path: root/src/cache/ftcsbits.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cache/ftcsbits.c')
-rw-r--r--src/cache/ftcsbits.c36
1 files changed, 2 insertions, 34 deletions
diff --git a/src/cache/ftcsbits.c b/src/cache/ftcsbits.c
index 54f044404..8f8a25a28 100644
--- a/src/cache/ftcsbits.c
+++ b/src/cache/ftcsbits.c
@@ -288,38 +288,6 @@
FTC_SBit sbit = snode->sbits + ( gindex - gnode->gindex );
- /*
- * The following code illustrates what to do when you want to
- * perform operations that may fail within a lookup function.
- *
- * Here, we want to load a small bitmap on-demand; we thus
- * need to call the `ftc_snode_load' function which may return
- * a non-zero error code only when we are out of memory (OOM).
- *
- * The correct thing to do is to use @FTC_CACHE_TRYLOOP and
- * @FTC_CACHE_TRYLOOP_END in order to implement a retry loop
- * that is capable of flushing the cache incrementally when
- * an OOM errors occur.
- *
- * However, we need to `lock' the node before this operation to
- * prevent it from being flushed within the loop.
- *
- * When we exit the loop, we unlock the node, then check the `error'
- * variable. If it is non-zero, this means that the cache was
- * completely flushed and that no usable memory was found to load
- * the bitmap.
- *
- * We then prefer to return a value of 0 (i.e., NO MATCH). This
- * ensures that the caller will try to allocate a new node.
- * This operation consequently _fail_ and the lookup function
- * returns the appropriate OOM error code.
- *
- * Note that `buffer == NULL && width == 255' is a hack used to
- * tag `unavailable' bitmaps in the array. We should never try
- * to load these.
- *
- */
-
if ( sbit->buffer == NULL && sbit->width != 255 )
{
FT_ULong size;
@@ -329,11 +297,11 @@
FTC_NODE_REF(snode); /* lock node to prevent flushing */
/* in retry loop */
- FTC_CACHE_TRYLOOP( cache )
+ FTC_RETR_LOOP( cache->manager )
{
error = ftc_snode_load( snode, cache->manager, gindex, &size );
}
- FTC_CACHE_TRYLOOP_END();
+ FTC_RETRY_END( error );
FTC_NODE(snode)->ref_count--; /* unlock the node */