2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /*%% (c) Copyright 1993, 1994 Hewlett-Packard Company */
24 /*%% (c) Copyright 1993, 1994 International Business Machines Corp. */
25 /*%% (c) Copyright 1993, 1994 Sun Microsystems, Inc. */
26 /*%% (c) Copyright 1993, 1994 Novell, Inc. */
27 /*%% $XConsortium: api_storage.h /main/3 1995/10/23 09:55:04 rswiston $ */
32 * Copyright (c) 1990 by Sun Microsystems, Inc.
34 * mark/release storage management for storage returned over api
36 #if !defined(_API_STORAGE_H)
37 #define _API_STORAGE_H
41 #include "util/tt_object.h"
42 #include "util/tt_list.h"
44 declare_list_of(_Tt_api_stg_stack_elm)
45 declare_ptr_to(_Tt_api_stg_stack)
47 class _Tt_api_stg_stack_elm : public _Tt_object {
49 _Tt_api_stg_stack_elm() {};
50 ~_Tt_api_stg_stack_elm();
51 enum {STACK_MARK, STACK_STORAGE} entry_type;
53 void print(FILE *fs = stdout) const;
56 class _Tt_api_stg_stack : public _Tt_object {
59 virtual ~_Tt_api_stg_stack();
61 void release(int mark);
62 #ifdef _DEBUG_MALLOC_INC
63 caddr_t debug_malloc(char *fname,int lnum,size_t size);
65 caddr_t malloc(size_t size);
67 // take(p,s) is for taking a normally ::malloc'ed chunk of
68 // storage and putting it under mark/release control.
69 caddr_t take(caddr_t addr);
70 #ifdef _DEBUG_MALLOC_INC
71 void debug_free(char *fname,int lnum,caddr_t addr);
73 void free(caddr_t addr);
75 void print(FILE *fs = stdout) const;
77 _Tt_api_stg_stack_elm_list_ptr stack;