internal
| 2755 | |
| 2756 | // internal |
| 2757 | asCGlobalProperty *asCScriptEngine::AllocateGlobalProperty() |
| 2758 | { |
| 2759 | asCGlobalProperty *prop = asNEW(asCGlobalProperty); |
| 2760 | if( prop == 0 ) |
| 2761 | { |
| 2762 | // Out of memory |
| 2763 | return 0; |
| 2764 | } |
| 2765 | |
| 2766 | // First check the availability of a free slot |
| 2767 | if( freeGlobalPropertyIds.GetLength() ) |
| 2768 | { |
| 2769 | prop->id = freeGlobalPropertyIds.PopLast(); |
| 2770 | globalProperties[prop->id] = prop; |
| 2771 | return prop; |
| 2772 | } |
| 2773 | |
| 2774 | prop->id = (asUINT)globalProperties.GetLength(); |
| 2775 | globalProperties.PushLast(prop); |
| 2776 | return prop; |
| 2777 | } |
| 2778 | |
| 2779 | // internal |
| 2780 | void asCScriptEngine::RemoveGlobalProperty(asCGlobalProperty *prop) |