/*
* Copyright (C) 2014, 2016 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/*! \file */
#include <config.h>
#include <stddef.h>
struct isc_counter {
unsigned int magic;
unsigned int references;
unsigned int limit;
unsigned int used;
};
return (ISC_R_NOMEMORY);
if (result != ISC_R_SUCCESS) {
return (result);
}
return (ISC_R_SUCCESS);
}
return (result);
}
unsigned int
}
void
}
void
source->references++;
}
static void
}
void
counter->references--;
if (counter->references == 0)
if (want_destroy)
}