1425bb815Sopenharmony_ci/* Copyright JS Foundation and other contributors, http://js.foundation
2425bb815Sopenharmony_ci *
3425bb815Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4425bb815Sopenharmony_ci * you may not use this file except in compliance with the License.
5425bb815Sopenharmony_ci * You may obtain a copy of the License at
6425bb815Sopenharmony_ci *
7425bb815Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8425bb815Sopenharmony_ci *
9425bb815Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10425bb815Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS
11425bb815Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12425bb815Sopenharmony_ci * See the License for the specific language governing permissions and
13425bb815Sopenharmony_ci * limitations under the License.
14425bb815Sopenharmony_ci */
15425bb815Sopenharmony_ci
16425bb815Sopenharmony_ci#ifndef ECMA_ALLOC_H
17425bb815Sopenharmony_ci#define ECMA_ALLOC_H
18425bb815Sopenharmony_ci
19425bb815Sopenharmony_ci#include "ecma-globals.h"
20425bb815Sopenharmony_ci
21425bb815Sopenharmony_ci/** \addtogroup ecma ECMA
22425bb815Sopenharmony_ci * @{
23425bb815Sopenharmony_ci *
24425bb815Sopenharmony_ci * \addtogroup ecmaalloc Routines for allocation/freeing memory for ECMA data types
25425bb815Sopenharmony_ci * @{
26425bb815Sopenharmony_ci */
27425bb815Sopenharmony_ci
28425bb815Sopenharmony_ci/**
29425bb815Sopenharmony_ci * Allocate memory for ecma-object
30425bb815Sopenharmony_ci *
31425bb815Sopenharmony_ci * @return pointer to allocated memory
32425bb815Sopenharmony_ci */
33425bb815Sopenharmony_ciecma_object_t *ecma_alloc_object (void);
34425bb815Sopenharmony_ci
35425bb815Sopenharmony_ci/**
36425bb815Sopenharmony_ci * Dealloc memory from an ecma-object
37425bb815Sopenharmony_ci */
38425bb815Sopenharmony_civoid ecma_dealloc_object (ecma_object_t *object_p);
39425bb815Sopenharmony_ci
40425bb815Sopenharmony_ci/**
41425bb815Sopenharmony_ci * Allocate memory for extended object
42425bb815Sopenharmony_ci *
43425bb815Sopenharmony_ci * @return pointer to allocated memory
44425bb815Sopenharmony_ci */
45425bb815Sopenharmony_ciecma_extended_object_t *ecma_alloc_extended_object (size_t size);
46425bb815Sopenharmony_ci
47425bb815Sopenharmony_ci/**
48425bb815Sopenharmony_ci * Dealloc memory of an extended object
49425bb815Sopenharmony_ci */
50425bb815Sopenharmony_civoid ecma_dealloc_extended_object (ecma_object_t *object_p, size_t size);
51425bb815Sopenharmony_ci
52425bb815Sopenharmony_ci/**
53425bb815Sopenharmony_ci * Allocate memory for ecma-number
54425bb815Sopenharmony_ci *
55425bb815Sopenharmony_ci * @return pointer to allocated memory
56425bb815Sopenharmony_ci */
57425bb815Sopenharmony_ciecma_number_t *ecma_alloc_number (void);
58425bb815Sopenharmony_ci
59425bb815Sopenharmony_ci/**
60425bb815Sopenharmony_ci * Dealloc memory from an ecma-number
61425bb815Sopenharmony_ci */
62425bb815Sopenharmony_civoid ecma_dealloc_number (ecma_number_t *number_p);
63425bb815Sopenharmony_ci
64425bb815Sopenharmony_ci/**
65425bb815Sopenharmony_ci * Allocate memory for ecma-string descriptor
66425bb815Sopenharmony_ci *
67425bb815Sopenharmony_ci * @return pointer to allocated memory
68425bb815Sopenharmony_ci */
69425bb815Sopenharmony_ciecma_string_t *ecma_alloc_string (void);
70425bb815Sopenharmony_ci
71425bb815Sopenharmony_ci/**
72425bb815Sopenharmony_ci * Dealloc memory from ecma-string descriptor
73425bb815Sopenharmony_ci */
74425bb815Sopenharmony_civoid ecma_dealloc_string (ecma_string_t *string_p);
75425bb815Sopenharmony_ci
76425bb815Sopenharmony_ci/**
77425bb815Sopenharmony_ci * Allocate memory for extended ecma-string descriptor
78425bb815Sopenharmony_ci *
79425bb815Sopenharmony_ci * @return pointer to allocated memory
80425bb815Sopenharmony_ci */
81425bb815Sopenharmony_ciecma_extended_string_t *ecma_alloc_extended_string (void);
82425bb815Sopenharmony_ci
83425bb815Sopenharmony_ci/**
84425bb815Sopenharmony_ci * Dealloc memory from extended ecma-string descriptor
85425bb815Sopenharmony_ci */
86425bb815Sopenharmony_civoid ecma_dealloc_extended_string (ecma_extended_string_t *string_p);
87425bb815Sopenharmony_ci
88425bb815Sopenharmony_ci/**
89425bb815Sopenharmony_ci * Allocate memory for string with character data
90425bb815Sopenharmony_ci *
91425bb815Sopenharmony_ci * @return pointer to allocated memory
92425bb815Sopenharmony_ci */
93425bb815Sopenharmony_ciecma_string_t *ecma_alloc_string_buffer (size_t size);
94425bb815Sopenharmony_ci
95425bb815Sopenharmony_ci/**
96425bb815Sopenharmony_ci * Dealloc memory of a string with character data
97425bb815Sopenharmony_ci */
98425bb815Sopenharmony_civoid ecma_dealloc_string_buffer (ecma_string_t *string_p, size_t size);
99425bb815Sopenharmony_ci
100425bb815Sopenharmony_ci/**
101425bb815Sopenharmony_ci * Allocate memory for ecma-property pair
102425bb815Sopenharmony_ci *
103425bb815Sopenharmony_ci * @return pointer to allocated memory
104425bb815Sopenharmony_ci */
105425bb815Sopenharmony_ciecma_property_pair_t *ecma_alloc_property_pair (void);
106425bb815Sopenharmony_ci
107425bb815Sopenharmony_ci/**
108425bb815Sopenharmony_ci * Dealloc memory from an ecma-property pair
109425bb815Sopenharmony_ci */
110425bb815Sopenharmony_civoid ecma_dealloc_property_pair (ecma_property_pair_t *property_pair_p);
111425bb815Sopenharmony_ci
112425bb815Sopenharmony_ci/**
113425bb815Sopenharmony_ci * @}
114425bb815Sopenharmony_ci * @}
115425bb815Sopenharmony_ci */
116425bb815Sopenharmony_ci
117425bb815Sopenharmony_ci#endif /* !ECMA_ALLOC_H */
118