2 * Copyright (C) 2007-2010 Openismus GmbH
5 * Mathias Hasselmann <mathias@openismus.com>
6 * Tristan Van Berkom <tristan.van.berkom@gmail.com>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
24 #include "gtksizerequestcacheprivate.h"
29 _gtk_size_request_cache_init (SizeRequestCache *cache)
31 memset (cache, 0, sizeof (SizeRequestCache));
35 free_sizes (SizeRequest **sizes)
39 for (i = 0; i < GTK_SIZE_REQUEST_CACHED_SIZES && sizes[i] != NULL; i++)
40 g_slice_free (SizeRequest, sizes[i]);
42 g_slice_free1 (sizeof (SizeRequest *) * GTK_SIZE_REQUEST_CACHED_SIZES, sizes);
46 _gtk_size_request_cache_free (SizeRequestCache *cache)
49 free_sizes (cache->widths);
51 free_sizes (cache->heights);
55 _gtk_size_request_cache_clear (SizeRequestCache *cache)
58 _gtk_size_request_cache_free (cache);
59 _gtk_size_request_cache_init (cache);