#include "linden_common.h"
#include "lscript_alloc.h"
#include "llrand.h"
Go to the source code of this file.
Functions | |
void | reset_hp_to_safe_spot (const U8 *buffer) |
BOOL | lsa_create_heap (U8 *heap_start, S32 size) |
S32 | lsa_heap_top (U8 *heap_start, S32 maxtop) |
S32 | lsa_heap_add_data (U8 *buffer, LLScriptLibData *data, S32 heapsize, BOOL b_delete) |
void | lsa_split_block (U8 *buffer, S32 &offset, S32 size, LLScriptAllocEntry &entry) |
void | lsa_insert_data (U8 *buffer, S32 &offset, LLScriptLibData *data, LLScriptAllocEntry &entry, S32 heapsize) |
S32 | lsa_create_data_block (U8 **buffer, LLScriptLibData *data, S32 base_offset) |
void | lsa_increase_ref_count (U8 *buffer, S32 offset) |
void | lsa_decrease_ref_count (U8 *buffer, S32 offset) |
LLScriptLibData * | lsa_get_data (U8 *buffer, S32 &offset, BOOL b_dec_ref) |
LLScriptLibData * | lsa_get_list_ptr (U8 *buffer, S32 &offset, BOOL b_dec_ref) |
S32 | lsa_cat_strings (U8 *buffer, S32 offset1, S32 offset2, S32 heapsize) |
S32 | lsa_cmp_strings (U8 *buffer, S32 offset1, S32 offset2) |
void | lsa_print_heap (U8 *buffer) |
void | lsa_fprint_heap (U8 *buffer, LLFILE *fp) |
S32 | lsa_cat_lists (U8 *buffer, S32 offset1, S32 offset2, S32 heapsize) |
S32 | lsa_cmp_lists (U8 *buffer, S32 offset1, S32 offset2) |
S32 | lsa_preadd_lists (U8 *buffer, LLScriptLibData *data, S32 offset2, S32 heapsize) |
S32 | lsa_postadd_lists (U8 *buffer, S32 offset1, LLScriptLibData *data, S32 heapsize) |
LLScriptLibData * | lsa_randomize (LLScriptLibData *src, S32 stride) |
Variables | |
char | gLSAStringRead [TOP_OF_MEMORY] |
Definition at line 921 of file lscript_alloc.cpp.
References get_register(), LREG_FR, lsa_get_data(), lsa_heap_add_data(), LSRF_HEAP_ERROR, LST_LIST, LLScriptLibData::mListp, LLScriptLibData::mType, NULL, tut::runner, set_fault(), and TRUE.
Referenced by list_list_operation().
Definition at line 662 of file lscript_alloc.cpp.
References get_register(), LREG_FR, lsa_get_data(), lsa_heap_add_data(), LSRF_HEAP_ERROR, LST_KEY, LST_STRING, LLScriptLibData::mKey, LLScriptLibData::mString, LLScriptLibData::mType, NULL, S32, set_fault(), and TRUE.
Referenced by string_string_operation().
Definition at line 973 of file lscript_alloc.cpp.
References FALSE, get_register(), LLScriptLibData::getListLength(), LREG_FR, lsa_get_data(), LSRF_HEAP_ERROR, LST_LIST, LLScriptLibData::mType, S32, set_fault(), and TRUE.
Referenced by list_list_operation().
Definition at line 730 of file lscript_alloc.cpp.
References get_register(), LREG_FR, lsa_get_data(), LSRF_HEAP_ERROR, LST_KEY, LST_STRING, LLScriptLibData::mKey, LLScriptLibData::mString, LLScriptLibData::mType, NULL, S32, set_fault(), and TRUE.
Referenced by key_key_operation(), key_string_operation(), string_key_operation(), and string_string_operation().
S32 lsa_create_data_block | ( | U8 ** | buffer, | |
LLScriptLibData * | data, | |||
S32 | base_offset | |||
) |
Definition at line 329 of file lscript_alloc.cpp.
References alloc_entry2bytestream(), byte2bytestream(), char2bytestream(), float2bytestream(), LLScriptLibData::getListLength(), integer2bytestream(), llendl, llerrs, lsa_create_data_block(), LSCRIPTDataSize, LST_FLOATINGPOINT, LST_INTEGER, LST_KEY, LST_LIST, LST_NULL, LST_QUATERNION, LST_STRING, LST_VECTOR, MAX_HEAP_SIZE, LLScriptLibData::mFP, LLScriptLibData::mInteger, LLScriptLibData::mKey, LLScriptLibData::mListp, LLScriptLibData::mQuat, LLScriptAllocEntry::mReferenceCount, LLScriptAllocEntry::mSize, LLScriptLibData::mString, LLScriptLibData::mType, LLScriptAllocEntry::mType, LLScriptLibData::mVec, NULL, quaternion2bytestream(), S32, SIZEOF_SCRIPT_ALLOC_ENTRY, and vector2bytestream().
Referenced by lsa_create_data_block(), LLScriptScript::recurse(), LLScriptGlobalVariable::recurse(), LLScriptSAList::recurse(), and LLScriptConstantString::recurse().
Definition at line 69 of file lscript_alloc.cpp.
References alloc_entry2bytestream(), LST_NULL, S32, and TRUE.
Definition at line 488 of file lscript_alloc.cpp.
References alloc_entry2bytestream(), bytestream2alloc_entry(), bytestream2integer(), get_register(), i, LREG_FR, LREG_HP, LREG_HR, lsa_decrease_ref_count(), LSRF_BOUND_CHECK_ERROR, LSRF_HEAP_ERROR, LST_LIST, LST_NULL, LLScriptAllocEntry::mReferenceCount, LLScriptAllocEntry::mType, S32, and set_fault().
Referenced by lsa_decrease_ref_count(), lsa_get_data(), lsa_get_list_ptr(), lscript_pop_variable(), lscript_stacktol_pop_variable(), run_cast(), run_jumpif(), run_jumpnif(), run_loadglp(), run_loadgsp(), run_loadlp(), run_loadsp(), run_popl(), run_pops(), run_print(), run_storegl(), run_storegs(), run_storel(), and run_stores().
Definition at line 854 of file lscript_alloc.cpp.
References bytestream2alloc_entry(), bytestream2char(), bytestream2float(), bytestream2integer(), bytestream2quaternion(), bytestream2vector(), get_register(), LREG_HR, LSCRIPTTypeNames, LST_FLOATINGPOINT, LST_INTEGER, LST_KEY, LST_LIST, LST_QUATERNION, LST_STRING, LST_VECTOR, MAX_HEAP_SIZE, LLQuaternion::mQ, LLScriptAllocEntry::mReferenceCount, LLScriptAllocEntry::mSize, LLScriptAllocEntry::mType, LLVector3::mV, S32, VS, VX, VY, and VZ.
Referenced by LLScriptLSOParse::printHeap().
LLScriptLibData* lsa_get_data | ( | U8 * | buffer, | |
S32 & | offset, | |||
BOOL | b_dec_ref | |||
) |
Definition at line 532 of file lscript_alloc.cpp.
References bytestream2alloc_entry(), bytestream2char(), bytestream2float(), bytestream2integer(), bytestream2quaternion(), bytestream2vector(), LLScriptLibData::checkForMultipleLists(), FALSE, get_register(), gLSAStringRead, i, LREG_FR, LREG_HP, LREG_HR, lsa_decrease_ref_count(), lsa_get_data(), LSRF_BOUND_CHECK_ERROR, LSRF_HEAP_ERROR, LSRF_NESTING_LISTS, LST_FLOATINGPOINT, LST_INTEGER, LST_KEY, LST_LIST, LST_QUATERNION, LST_STRING, LST_VECTOR, LLScriptLibData::mFP, LLScriptLibData::mInteger, LLScriptLibData::mKey, LLScriptLibData::mListp, LLScriptLibData::mQuat, LLScriptLibData::mString, LLScriptLibData::mType, LLScriptAllocEntry::mType, LLScriptLibData::mVec, S32, and set_fault().
Referenced by key_list_operation(), list_key_operation(), list_string_operation(), lsa_cat_lists(), lsa_cat_strings(), lsa_cmp_lists(), lsa_cmp_strings(), lsa_get_data(), lsa_get_list_ptr(), lsa_postadd_lists(), lsa_preadd_lists(), lscript_stacktol_pop_variable(), run_cast(), run_print(), and string_list_operation().
LLScriptLibData* lsa_get_list_ptr | ( | U8 * | buffer, | |
S32 & | offset, | |||
BOOL | b_dec_ref | |||
) |
Definition at line 612 of file lscript_alloc.cpp.
References bytestream2alloc_entry(), bytestream2integer(), FALSE, get_register(), i, LREG_FR, LREG_HP, LREG_HR, lsa_decrease_ref_count(), lsa_get_data(), LSRF_BOUND_CHECK_ERROR, LSRF_HEAP_ERROR, LST_LIST, LLScriptLibData::mListp, LLScriptAllocEntry::mType, NULL, S32, and set_fault().
Referenced by lscript_pop_variable(), run_jumpif(), and run_jumpnif().
S32 lsa_heap_add_data | ( | U8 * | buffer, | |
LLScriptLibData * | data, | |||
S32 | heapsize, | |||
BOOL | b_delete | |||
) |
Definition at line 115 of file lscript_alloc.cpp.
References alloc_entry2bytestream(), bytestream2alloc_entry(), LLScriptLibData::checkForMultipleLists(), get_register(), LLScriptLibData::getListLength(), LREG_FR, LREG_HP, LREG_HR, lsa_insert_data(), lsa_split_block(), LSRF_NESTING_LISTS, LSRF_STACK_HEAP_COLLISION, LST_FLOATINGPOINT, LST_INTEGER, LST_KEY, LST_LIST, LST_QUATERNION, LST_STRING, LST_VECTOR, LLScriptLibData::mKey, LLScriptAllocEntry::mReferenceCount, LLScriptAllocEntry::mSize, LLScriptLibData::mString, LLScriptAllocEntry::mType, LLScriptLibData::mType, reset_hp_to_safe_spot(), S32, set_fault(), set_register(), and SIZEOF_SCRIPT_ALLOC_ENTRY.
Referenced by lsa_cat_lists(), lsa_cat_strings(), lsa_insert_data(), lsa_postadd_lists(), lsa_preadd_lists(), lscript_push_return_variable(), lscript_push_variable(), run_cast(), run_pushargs(), run_stacktol(), and run_stacktos().
Definition at line 80 of file lscript_alloc.cpp.
References bytestream2alloc_entry(), LLScriptAllocEntry::mSize, and S32.
Definition at line 461 of file lscript_alloc.cpp.
References alloc_entry2bytestream(), bytestream2alloc_entry(), get_register(), LREG_FR, LREG_HP, LREG_HR, LSRF_BOUND_CHECK_ERROR, LLScriptAllocEntry::mReferenceCount, S32, and set_fault().
Referenced by run_dupl(), run_dups(), run_pushgl(), run_pushgs(), run_pushl(), run_pushs(), run_storegl(), run_storegs(), run_storel(), and run_stores().
void lsa_insert_data | ( | U8 * | buffer, | |
S32 & | offset, | |||
LLScriptLibData * | data, | |||
LLScriptAllocEntry & | entry, | |||
S32 | heapsize | |||
) |
Definition at line 284 of file lscript_alloc.cpp.
References char2bytestream(), FALSE, float2bytestream(), get_register(), LLScriptLibData::getListLength(), integer2bytestream(), LREG_FR, lsa_heap_add_data(), LST_FLOATINGPOINT, LST_INTEGER, LST_KEY, LST_LIST, LST_QUATERNION, LST_STRING, LST_VECTOR, LLScriptLibData::mFP, LLScriptLibData::mInteger, LLScriptLibData::mKey, LLScriptLibData::mListp, LLScriptLibData::mQuat, LLScriptLibData::mString, LLScriptLibData::mType, LLScriptLibData::mVec, quaternion2bytestream(), S32, and vector2bytestream().
Referenced by lsa_heap_add_data().
S32 lsa_postadd_lists | ( | U8 * | buffer, | |
S32 | offset1, | |||
LLScriptLibData * | data, | |||
S32 | heapsize | |||
) |
Definition at line 1051 of file lscript_alloc.cpp.
References get_register(), LREG_FR, lsa_get_data(), lsa_heap_add_data(), LSRF_HEAP_ERROR, LST_LIST, LLScriptLibData::mListp, LLScriptLibData::mType, tut::runner, set_fault(), and TRUE.
Referenced by list_float_operation(), list_integer_operation(), list_key_operation(), list_quaternion_operation(), list_string_operation(), and list_vector_operation().
S32 lsa_preadd_lists | ( | U8 * | buffer, | |
LLScriptLibData * | data, | |||
S32 | offset2, | |||
S32 | heapsize | |||
) |
Definition at line 1016 of file lscript_alloc.cpp.
References get_register(), LREG_FR, lsa_get_data(), lsa_heap_add_data(), LSRF_HEAP_ERROR, LST_LIST, LLScriptLibData::mListp, LLScriptLibData::mType, tut::runner, set_fault(), and TRUE.
Referenced by float_list_operation(), integer_list_operation(), key_list_operation(), quaternion_list_operation(), string_list_operation(), and vector_list_operation().
void lsa_print_heap | ( | U8 * | buffer | ) |
Definition at line 784 of file lscript_alloc.cpp.
References bytestream2alloc_entry(), bytestream2char(), bytestream2float(), bytestream2integer(), bytestream2quaternion(), bytestream2vector(), get_register(), LREG_HP, LREG_HR, LSCRIPTTypeNames, LST_FLOATINGPOINT, LST_INTEGER, LST_KEY, LST_LIST, LST_QUATERNION, LST_STRING, LST_VECTOR, MAX_HEAP_SIZE, LLQuaternion::mQ, LLScriptAllocEntry::mReferenceCount, LLScriptAllocEntry::mSize, LLScriptAllocEntry::mType, LLVector3::mV, S32, VS, VX, VY, and VZ.
Referenced by LLScriptExecute::run().
LLScriptLibData* lsa_randomize | ( | LLScriptLibData * | src, | |
S32 | stride | |||
) |
Definition at line 1084 of file lscript_alloc.cpp.
References LLScriptLibData::getListLength(), ll_rand(), LLScriptLibData::mListp, NULL, and S32.
void lsa_split_block | ( | U8 * | buffer, | |
S32 & | offset, | |||
S32 | size, | |||
LLScriptAllocEntry & | entry | |||
) |
Definition at line 260 of file lscript_alloc.cpp.
References alloc_entry2bytestream(), get_register(), LREG_FR, LLScriptAllocEntry::mSize, S32, and SIZEOF_SCRIPT_ALLOC_ENTRY.
Referenced by lsa_heap_add_data().
void reset_hp_to_safe_spot | ( | const U8 * | buffer | ) |
Definition at line 63 of file lscript_alloc.cpp.
References LREG_HP, set_register(), and TOP_OF_MEMORY.
Referenced by bytestream2alloc_entry(), lsa_heap_add_data(), and set_fault().
char gLSAStringRead[TOP_OF_MEMORY] |