This repository has been archived by the owner on Nov 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvariable.c
52 lines (42 loc) · 1.72 KB
/
variable.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
+--------------------------------------------------------------------------+
| Zephir Language |
+--------------------------------------------------------------------------+
| Copyright (c) 2013-2014 Zephir Team and contributors |
+--------------------------------------------------------------------------+
| This source file is subject the MIT license, that is bundled with |
| this package in the file LICENSE, and is available through the |
| world-wide-web at the following url: |
| http://zephir-lang.com/license.html |
| |
| If you did not receive a copy of the MIT license and are unable |
| to obtain it through the world-wide-web, please send a note to |
| [email protected] so we can mail you a copy immediately. |
+--------------------------------------------------------------------------+
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <php.h>
#include "php_zephir.h"
#include "zephir.h"
#include "builder.h"
#include "utils.h"
void zephir_variable_incr_uses(zephir_variable *variable)
{
}
void zephir_variable_incr_mutations(zephir_variable *variable)
{
}
/**
* Initializes a variant variable
*/
void zephir_variable_init_variant(zephir_variable *variable, zephir_context *context)
{
if (variable->variant_inits > 0 || context->inside_cycle > 0) {
zephir_build_memory_nalloc(context, variable->value_ref);
} else {
zephir_build_memory_alloc(context, variable->value_ref);
}
variable->variant_inits++;
}