Point Cloud Library (PCL) 1.15.0
Loading...
Searching...
No Matches
opennurbs_memory.h
1/* $NoKeywords: $ */
2/*
3//
4// Copyright (c) 1993-2012 Robert McNeel & Associates. All rights reserved.
5// OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert
6// McNeel & Associates.
7//
8// THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
9// ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
10// MERCHANTABILITY ARE HEREBY DISCLAIMED.
11//
12// For complete openNURBS copyright information see <http://www.opennurbs.org>.
13//
14////////////////////////////////////////////////////////////////
15*/
16
17#if !defined(OPENNURBS_MEMORY_INC_)
18#define OPENNURBS_MEMORY_INC_
19
20#if defined (cplusplus) || defined(_cplusplus) || defined(__cplusplus)
21extern "C" {
22#endif
23
24ON_DECL
25size_t ON_MemoryPageSize();
26
27#define ON_MEMORY_POOL void
28
29ON_DECL
30ON_MEMORY_POOL* ON_MainMemoryPool(void);
31
32ON_DECL
33ON_MEMORY_POOL* ON_WorkerMemoryPool(void);
34
35ON_DECL
36void* onmalloc( size_t );
37
38ON_DECL
39void* onmalloc_from_pool( ON_MEMORY_POOL*, size_t );
40
41ON_DECL
42void* oncalloc( size_t, size_t );
43
44ON_DECL
45void* oncalloc_from_pool( ON_MEMORY_POOL*, size_t, size_t );
46
47ON_DECL
48void onfree( void* );
49
50ON_DECL
51void* onrealloc( void*, size_t );
52
53ON_DECL
54void* onrealloc_from_pool( ON_MEMORY_POOL*, void*, size_t );
55
56ON_DECL
57size_t onmsize( const void* );
58
59ON_DECL
60void* onmemdup( const void*, size_t );
61
62ON_DECL
63char* onstrdup( const char* );
64
65#if defined(_WCHAR_T_DEFINED)
66ON_DECL
67wchar_t* onwcsdup( const wchar_t* );
68#endif
69
70ON_DECL
71unsigned char* onmbsdup( const unsigned char* );
72
73ON_DECL
74size_t onmemoryusecount(
75 size_t* malloc_count,
76 size_t* realloc_count,
77 size_t* free_count,
78 size_t* pool_count
79 );
80
81ON_DECL
82size_t onmemoryusecountex(
83 size_t* malloc_count,
84 size_t* realloc_count,
85 size_t* free_count,
86 size_t* pool_count,
87 size_t* malloc_zero_count,
88 size_t* free_null_count
89 );
90
91/* define to handle _TCHAR* ontcsdup( const _TCHAR* ) */
92#if defined(_UNICODE)
93#define ontcsdup onwcsdup
94#elif defined(_MBCS)
95#define ontcsdup onmbsdup
96#else
97#define ontcsdup onstrdup
98#endif
99
100#if defined (cplusplus) || defined(_cplusplus) || defined(__cplusplus)
101}
102#endif
103
104#endif