summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ca00c40)
Useful, for example, if you're growing a dynamically allocated array.
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
* TTLs get inherited by their parents.
*/
* TTLs get inherited by their parents.
*/
+void adns__free_interim(adns_query qu, void *p);
+/* Forget about a block allocated by adns__alloc_interim.
+ */
+
void *adns__alloc_mine(adns_query qu, size_t sz);
/* Like _interim, but does not record the length for later
* copying into the answer. This just ensures that the memory
void *adns__alloc_mine(adns_query qu, size_t sz);
/* Like _interim, but does not record the length for later
* copying into the answer. This just ensures that the memory
+void adns__free_interim(adns_query qu, void *p) {
+ size_t sz;
+ allocnode *an= alloc_info(qu, p, &sz);
+
+ if (!an) return;
+ assert(!qu->final_allocspace);
+ LIST_UNLINK(qu->allocations, an);
+ free(an);
+ qu->interim_allocd -= sz;
+}
+
void *adns__alloc_mine(adns_query qu, size_t sz) {
return alloc_common(qu,MEM_ROUND(sz));
}
void *adns__alloc_mine(adns_query qu, size_t sz) {
return alloc_common(qu,MEM_ROUND(sz));
}