source: Sophya/trunk/SophyaPI/PIGcont/gp_alloc.h@ 3468

Last change on this file since 3468 was 1844, checked in by ansari, 24 years ago

changement de nom des fichiers (ajout de gp_ ou gpc_ ) pour eviter les confusions - Reza 30/12/2001

File size: 3.2 KB
RevLine 
[1838]1
2/* GNUPLOT - gp_alloc.h (alloc.h renamed to gp_alloc.h) */
3
4/*[
5 * Copyright 1986 - 1993, 1998 Thomas Williams, Colin Kelley
6 *
7 * Permission to use, copy, and distribute this software and its
8 * documentation for any purpose with or without fee is hereby granted,
9 * provided that the above copyright notice appear in all copies and
10 * that both that copyright notice and this permission notice appear
11 * in supporting documentation.
12 *
13 * Permission to modify the software is granted, but not the right to
14 * distribute the complete modified source code. Modifications are to
15 * be distributed as patches to the released version. Permission to
16 * distribute binaries produced by compiling modified sources is granted,
17 * provided you
18 * 1. distribute the corresponding source modifications from the
19 * released version in the form of a patch file along with the binaries,
20 * 2. add special version identification to distinguish your version
21 * in addition to the base release version number,
22 * 3. provide your name and address as the primary contact for the
23 * support of your modified version, and
24 * 4. retain our contact information in regard to use of the base
25 * software.
26 * Permission to distribute the released version of the source code along
27 * with corresponding source modifications in the form of a patch file is
28 * granted with same provisions 2 through 4 for binary distributions.
29 *
30 * This software is provided "as is" without express or implied warranty
31 * to the extent permitted by applicable law.
32]*/
33
34#ifndef GNUPLOT_ALLOC_H
35# define GNUPLOT_ALLOC_H
36
37#include <stdio.h>
38#include <stdlib.h>
[1844]39#include "gp_graph3d.h"
[1838]40/****
41#ifdef HAVE_CONFIG_H
42# include "config.h"
43#endif
44
45#include "stdfn.h"
46****/
47/* prototypes from "alloc.c". This file figures out if the free hack is needed
48 * and redefines free if necessary.
49 */
50
51void *gp_alloc(size_t size, const char *message);
52void *gp_realloc(void *p, size_t size, const char *message);
53struct iso_curve *iso_alloc(int);
54
55void iso_free(struct iso_curve *);
56void gp_free(void *);
57void contour_free(struct gnuplot_contours *ptr);
58/* dont define CHECK_HEAP_USE on a FARALLOC machine ! */
59
60#ifdef CHECK_HEAP_USE
61
62/* all allocated blocks have guards at front and back.
63 * CHECK_POINTER checks guards on block, and checks that p is in range
64 * START_LEAK_CHECK and END_LEAK_CHECK allow assert that no net memory
65 * is allocated within enclosed block
66 */
67
68void checked_free(void *p);
69void check_pointer_in_block(void *block, void *p, int size, char *file, int line);
70void start_leak_check(char *file,int line);
71void end_leak_check(char *file,int line);
72/*# define free(x) checked_free(x)*/
73# define CHECK_POINTER(block, p) check_pointer_in_block(block, p, sizeof(*p), __FILE__, __LINE__)
74# define START_LEAK_CHECK() start_leak_check(__FILE__, __LINE__)
75# define END_LEAK_CHECK() end_leak_check(__FILE__, __LINE__)
76#else
77# define CHECK_POINTER(block, p) /*nowt*/
78# define START_LEAK_CHECK() /*nowt*/
79# define END_LEAK_CHECK() /*nowt*/
80#endif
81
82/***
83#if defined(MSDOS) && defined(__TURBOC__) && !defined(DOSX286) || defined(_Windows) && !defined(WIN32)
84#define FARALLOC
85void gpfree((generic *p));
86#define free gpfree
87#endif
88***/
89#endif /* GNUPLOT_ALLOC_H */
Note: See TracBrowser for help on using the repository browser.