lscript_alloc.h File Reference

General heap management for scripting system. More...

#include "lscript_byteconvert.h"
#include "lscript_library.h"

Include dependency graph for lscript_alloc.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  LLScriptAllocEntry

Functions

void reset_hp_to_safe_spot (const U8 *buffer)
void alloc_entry2bytestream (U8 *buffer, S32 &offset, const LLScriptAllocEntry &entry)
void bytestream2alloc_entry (LLScriptAllocEntry &entry, U8 *buffer, S32 &offset)
BOOL lsa_create_heap (U8 *heap_start, S32 size)
void lsa_fprint_heap (U8 *buffer, LLFILE *fp)
void lsa_print_heap (U8 *buffer)
S32 lsa_heap_add_data (U8 *buffer, LLScriptLibData *data, S32 heapsize, BOOL b_delete)
S32 lsa_heap_top (U8 *heap_start, S32 maxsize)
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)
S32 get_max_heap_size (U8 *buffer)
LLScriptLibDatalsa_get_data (U8 *buffer, S32 &offset, BOOL b_dec_ref)
LLScriptLibDatalsa_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)
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)
LLScriptLibDatalsa_bubble_sort (LLScriptLibData *src, S32 stride, S32 ascending)
LLScriptLibDatalsa_randomize (LLScriptLibData *src, S32 stride)

Variables

const S32 MAX_HEAP_SIZE = TOP_OF_MEMORY
const S32 SIZEOF_SCRIPT_ALLOC_ENTRY = 7


Detailed Description

General heap management for scripting system.

LicenseInfo
firstyear=2002&license=viewergpl

Copyright (c) 2002-2008, Linden Research, Inc.

Second Life Viewer Source Code The source code in this file ("Source Code") is provided by Linden Lab to you under the terms of the GNU General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other License"), formally executed by you and Linden Lab. Terms of the GPL can be found in doc/GPL-license.txt in this distribution, or online at http://secondlifegrid.net/programs/open_source/licensing/gplv2

There are special exceptions to the terms and conditions of the GPL as it is applied to this Source Code. View the full text of the exception in the file doc/FLOSS-exception.txt in this software distribution, or online at http://secondlifegrid.net/programs/open_source/licensing/flossexception

By copying, modifying or distributing this software, you acknowledge that you have read and understood your obligations described above, and agree to abide by those obligations.

ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, COMPLETENESS OR PERFORMANCE. $/LicenseInfo$

Definition in file lscript_alloc.h.


Function Documentation

void alloc_entry2bytestream ( U8 buffer,
S32 offset,
const LLScriptAllocEntry entry 
) [inline]

void bytestream2alloc_entry ( LLScriptAllocEntry entry,
U8 buffer,
S32 offset 
) [inline]

S32 get_max_heap_size ( U8 buffer  )  [inline]

LLScriptLibData* lsa_bubble_sort ( LLScriptLibData src,
S32  stride,
S32  ascending 
) [inline]

Definition at line 227 of file lscript_alloc.h.

References LLScriptLibData::getListLength(), i, j, LLScriptLibData::mListp, NULL, S32, and TRUE.

Here is the call graph for this function:

S32 lsa_cat_lists ( U8 buffer,
S32  offset1,
S32  offset2,
S32  heapsize 
)

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().

Here is the call graph for this function:

Here is the caller graph for this function:

S32 lsa_cat_strings ( U8 buffer,
S32  offset1,
S32  offset2,
S32  heapsize 
)

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().

Here is the call graph for this function:

Here is the caller graph for this function:

S32 lsa_cmp_lists ( U8 buffer,
S32  offset1,
S32  offset2 
)

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().

Here is the call graph for this function:

Here is the caller graph for this function:

S32 lsa_cmp_strings ( U8 buffer,
S32  offset1,
S32  offset2 
)

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().

Here is the call graph for this function:

Here is the caller graph for this function:

S32 lsa_create_data_block ( U8 **  buffer,
LLScriptLibData data,
S32  base_offset 
)

BOOL lsa_create_heap ( U8 heap_start,
S32  size 
)

Definition at line 69 of file lscript_alloc.cpp.

References alloc_entry2bytestream(), LST_NULL, S32, and TRUE.

Here is the call graph for this function:

void lsa_decrease_ref_count ( U8 buffer,
S32  offset 
)

void lsa_fprint_heap ( U8 buffer,
LLFILE fp 
)

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_heap_add_data ( U8 buffer,
LLScriptLibData data,
S32  heapsize,
BOOL  b_delete 
)

S32 lsa_heap_top ( U8 heap_start,
S32  maxsize 
)

Definition at line 80 of file lscript_alloc.cpp.

References bytestream2alloc_entry(), LLScriptAllocEntry::mSize, and S32.

Here is the call graph for this function:

void lsa_increase_ref_count ( U8 buffer,
S32  offset 
)

void lsa_insert_data ( U8 buffer,
S32 offset,
LLScriptLibData data,
LLScriptAllocEntry entry,
S32  heapsize 
)

S32 lsa_postadd_lists ( U8 buffer,
S32  offset1,
LLScriptLibData data,
S32  heapsize 
)

S32 lsa_preadd_lists ( U8 buffer,
LLScriptLibData data,
S32  offset2,
S32  heapsize 
)

void lsa_print_heap ( U8 buffer  ) 

Definition at line 784 of file lscript_alloc.cpp.

Referenced by LLScriptExecute::run().

Here is the caller graph for this function:

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.

Here is the call graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void reset_hp_to_safe_spot ( const U8 buffer  ) 

Definition at line 63 of file lscript_alloc.cpp.

Referenced by bytestream2alloc_entry(), lsa_heap_add_data(), and set_fault().

Here is the caller graph for this function:


Variable Documentation


Generated on Fri May 16 08:35:59 2008 for SecondLife by  doxygen 1.5.5