/* Return value: CAIRO_STATUS_SUCCESS if successful or CAIRO_STATUS_NO_MEMORY if insufficient memory is available.  */
cairo_status_t _cairo_hash_table_insert(cairo_hash_table_t *hash_table, cairo_hash_entry_t *key_and_value)
/* Return value: CAIRO_STATUS_SUCCESS if successful or CAIRO_STATUS_NO_MEMORY if insufficient memory is available.  */
cairo_status_t _cairo_hash_table_insert(cairo_hash_table_t *hash_table, cairo_hash_entry_t *key_and_value)
{
    cairo_hash_entry_t **entry;
    cairo_status_t status;
    assert (hash_table->iterating == 0);
    status = _cairo_hash_table_manage (hash_table);
    if (unlikely (status))
	return status;
    entry = _cairo_hash_table_lookup_unique_key (hash_table, key_and_value);
    if (ENTRY_IS_FREE (*entry))
	hash_table->free_entries--;
    *entry = key_and_value;
    hash_table->cache[key_and_value->hash & 31] = key_and_value;
    hash_table->live_entries++;
    return CAIRO_STATUS_SUCCESS;
}